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

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:4665987e91198e268a56bf72b220e7b4497619a0

commit r16-7933-g4665987e91198e268a56bf72b220e7b4497619a0
Author: Andrew Pinski <[email protected]>
Date:   Fri Mar 6 11:22:56 2026 -0800

    c: Fix pragma inside a pragma [PR97991}

    After r0-72806-gbc4071dd66fd4d, c_parser_consume_token will
    assert if we get a pragma inside c_parser_consume_token but
    pragma processing will call pragma_lex which then calls
    c_parser_consume_token. In the case of pragma with expansion
    (redefine_extname, message and sometimes pack [and some target
    specific pragmas]) we get the expanded tokens that includes
    CPP_PRAGMA. We should just allow it instead of doing an assert.
    This follows what the C++ front-end does even and we no longer
    have an ICE.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR c/97991

    gcc/c/ChangeLog:

            * c-parser.cc (c_parser_consume_token): Allow
            CPP_PRAGMA if inside a pragma.

    gcc/testsuite/ChangeLog:

            * c-c++-common/cpp/pr97991-1.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>
  • [Bug c/97991] [13/14/15/16 Regr... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to