https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
Richard Biener changed:
What|Removed |Added
Priority|P3 |P1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #11 from Jakub Jelinek ---
Perhaps it would be possible to arrange for the lexing of _Pragma string to get
the right locations for the simple case where _Pragma argument is a single
string literal without escapes etc., but as soon as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #10 from David Malcolm ---
Hence I *think* the issue here is that the locations of the tokens within
libcpp/directives.c:destringize_and_run don't respect macro expansions, leading
to the strange location for the ignore directive that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #9 from David Malcolm ---
Running with gcc-4.8.3, it appears that the strange-looking location of the
"ignore" is pre-existing behavior, and that the change in r226234 of where the
diagnostic occurs has simply exposed it.
Breakpoint
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #8 from David Malcolm ---
Looking at calls to linemap_compare_locations, the crucial comparison is the
comparison of the location of the 2nd diagnostic with that of the "ignore"
pragma:
Breakpoint 2, linemap_compare_locations (set=0x
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #6 from David Malcolm ---
(In reply to David Malcolm from comment #5)
[...snip...]
> That said, the location of the token from _Pragma looks wrong; note the
> underlines here:
>
> Breakpoint 2, handle_pragma_diagnostic (dummy=) at
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #5 from David Malcolm ---
As far as I can tell:
* _Pragma is handled by _cpp_do__Pragma which injects pragma tokens into the
token stream
* the resulting "ignore" pragmas are handled by
gcc/c-family/c-pragma.c:handle_pragma_diagno
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
--- Comment #2 from Paolo Carlini ---
Hi Jakub. I thought it was simply matter of using location_of instead of
DECL_SOURCE_LOCATION as I did in other places in that patch set, but in fact it
doesn't work, in order to avoid the spurious warning a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126
Andrew Pinski changed:
What|Removed |Added
Target Milestone|--- |6.0