[Bug c++/69126] [6 regression] _Pragma does not apply if part of a macro

dmalcolm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 7 18:00:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> I don't understand those interactions either, and agree it would be nice to
> first understand those.  Which is why I've CCed Dodji and David, in hopes
> they could shed some light into this.
FWIW I'm poking at it now.

> For whatever reason, the DECL_SOURCE_LOCATION of the x decl when it comes
> from macro is the locus where the macro is used rather than the locus in the
> macro.
I would have expected the DECL_SOURCE_LOCATION to be the locus of where the
macro is used, and indeed that was the case with gcc 4.8.3:

(gdb) p /x decl->decl_minimal.locus
$11 = 0x7ffffffd

(which is a macro expansion location)

(gdb) call inform (decl->decl_minimal.locus, "DECL_SOURCE_LOCATION of 2nd x
with gcc 4.8.3")
/tmp/test.cc:13:9: note: DECL_SOURCE_LOCATION of 2nd x with gcc 4.8.3
     int x;
         ^
/tmp/test.cc:17:5: note: in expansion of macro ‘MACRO’
     MACRO;
     ^


More information about the Gcc-bugs mailing list