[Bug c++/46836] reporting locations for names in std namespace could be improved

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 29 12:47:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46836

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-29 12:14:18 UTC ---
(In reply to comment #2)
> #pragma GCC canonical_header [header-name] [identifier]

I don't think we even need to do it per-identifier.

If each standard header started with:

#pragma GCC canonical_header push [header-name]

and ended with:

#pragma GCC canonical_header pop

then we'd always know which header we're "in" when an error occurs, even for
nested headers (e.g. <fstream> includes <ios>) and helper files that are
included from many places (e.g. bits/stl_tree.h gets included by both <map> and
<set>)



More information about the Gcc-bugs mailing list