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

            Bug ID: 127041
           Summary: ICE in cp_lexer_handle_early_pragma with malformed
                    _Pragma
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: s.kimura.h41104 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/68xfdzb76

Reproducer:
```
_Pragma _Pragma("GCC diagnostic")
```

Backtrace:
<source>:1:33: error: '_Pragma' takes a parenthesized string literal
    1 | _Pragma _Pragma("GCC diagnostic")
      |                                 ^
<source>:1:1: internal compiler error: in cp_lexer_handle_early_pragma, at
cp/parser.cc:736
    1 | _Pragma _Pragma("GCC diagnostic")
      | ^~~~~~~
0x2bebac8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2be070b internal_error(char const*, ...)
        ???:0
0xb488c0 fancy_abort(char const*, int, char const*)
        ???:0
0xf32839 c_common_parse_file()
        ???:0

This ICE goes back to gcc-13:
https://godbolt.org/z/K5sMjEPah
  • [Bug c++/127041] New: ICE in... s.kimura.h41104 at gmail dot com via Gcc-bugs

Reply via email to