This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46836] reporting locations for names in std namespace could be improved
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 May 2012 13:50:17 +0000
- Subject: [Bug c++/46836] reporting locations for names in std namespace could be improved
- Auto-submitted: auto-generated
- References: <bug-46836-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46836
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #7 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-05-29 13:50:17 UTC ---
(In reply to comment #6)
> (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>)
Well, we already have pragma system_header, we could extend it with an optional
parameter.
#pragma GCC system_header "canonical_name"
and when the pragma is read, save "canonical_name". Then when printing the name
of a file, we could check that it is a system-header and there is a saved
canonical_name. System-headerness is reset when leaving a file (but I think not
when including something from a system header), so you don't need explicit
push/pop.