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

            Bug ID: 124307
           Summary: ICE: tree check: expected tree_list, have error_mark
                    in get_attribute_name, at attribs.cc:1062
           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:
class : alignas

Command:
g++ test.cpp

Output:
<source>:1:16: error: expected '(' at end of input
    1 | class : alignas
      |                ^
      |                (
<source>:1:16: internal compiler error: tree check: expected tree_list, have
error_mark in get_attribute_name, at attribs.cc:1062
0x2963338 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x295807b internal_error(char const*, ...)
        ???:0
0xa26c3b tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ???:0
0xe3b28c annotation_p(tree_node*)
        ???:0
0xd6d023 c_parse_file()
        ???:0
0xef6ef9 c_common_parse_file()
        ???:0
/cefs/5b/5b7473000a337cbbdec6c161_gcc-trunk-20260226/bin/../libexec/gcc/x86_64-linux-gnu/16.0.1/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/5b/5b7473000a337cbbdec6c161_gcc-trunk-20260226/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

See Compiler Explorer: https://godbolt.org/z/YY8a6Yoqz

This only occurs in GCC-trunk.

The test case was generated by a fuzzer.

Reply via email to