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

Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=97498
                 CC|                            |lhyatt at gcc dot gnu.org

--- Comment #20 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
See PR97498 which is closely related to this. It seems that the use of
input_location while handling diagnostic pragmas is problematic in other cases
besides the one discussed here (i.e. also when processing a diagnostic pop.)

Here is a test case from that PR, which breaks because of the input_location
workaround discussed here though:

======
static void f() {} _Pragma("GCC diagnostic error \"-Wunused-function\"")
======

The above errors for C but not C++, because in C, input_location points to the
start of the line and so it takes effect too early.

Reply via email to