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

            Bug ID: 123834
           Summary: ICE in cp_parser_translation_unit, at
                    cp/parser.cc:5602
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: suyuchang at whu dot edu.cn
  Target Milestone: ---

Input:
alignas( enum { } enum &... ) ;

Command:
g++ test.cpp

Output:
<source>:1:10: error: two or more data types in declaration of 'type name'
1 | alignas( enum { } enum &... ) ;
| ^~~~
<source>:1:10: error: expected primary-expression before 'enum'
<source>:1:1: warning: attribute ignored [-Wattributes]
1 | alignas( enum { } enum &... ) ;
| ^~~~~~~~~~~~~~~~~~
<source>:1:25: error: expected identifier before '&' token
1 | alignas( enum { } enum &... ) ;
| ^
<source>:1:26: error: expected unqualified-id before '...' token
1 | alignas( enum { } enum &... ) ;
| ^~~
<source>:1:32: internal compiler error: in cp_parser_translation_unit, at
cp/parser.cc:5602
1 | alignas( enum { } enum &... ) ;
| ^
0x2952bb8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag () [1], diagnostics::kind)
???:0
0x29478fb internal_error(char const, ...)
???:0
0xb1e3cc fancy_abort(char const*, int, char const*)
???:0
0xeee549 c_common_parse_file()
???:0
/cefs/e2/e208000267cce234eb736ef3_gcc-trunk-20260127/bin/../libexec/gcc/x86_64-linux-gnu/16.0.1/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/e2/e208000267cce234eb736ef3_gcc-trunk-20260127/bin/../lib/gcc/x86_64-linux-gnu/16.0.1/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext
.cpp -masm=intel -mtune=generic -march=x86-64 -g -fdiagnostics-color=always
-fno-verbose-asm -o /app/output.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See https://gcc.gnu.org/bugs/
 for instructions.
Compiler returned: 1

This only occurs in GCC-trunk, and this also makes released GCC "confused by
earlier errors, bailing out".

The test case was generated by a fuzzer.

Reply via email to