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

            Bug ID: 124519
           Summary: ICE: tree check: expected record_type or union_type or
                    qual_union_type, have enumeral_type in
                    check_special_function_return_type, at
                    cp/decl.cc:13645
           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: ---

Code:
template < ... >  a () alignas ( enum class  a ;

Command:
g++ test.cpp

Output:
test.cpp:1:48: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have enumeral_type in
check_special_function_return_type, at cp/decl.cc:13645
    1 | template < ... >  a () alignas ( enum class  a ;
      |                                                ^
0x2cb8d8e internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xad0143 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc-trunk/gcc/tree.cc:9219
0x860b12 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
        ../../gcc-trunk/gcc/tree.h:3820
0x860b12 check_special_function_return_type
        ../../gcc-trunk/gcc/cp/decl.cc:13645
0xd0ac89 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../gcc-trunk/gcc/cp/decl.cc:14397
0xd13c67 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc-trunk/gcc/cp/decl.cc:6561
0xe6e5c8 cp_parser_init_declarator
        ../../gcc-trunk/gcc/cp/parser.cc:26211
0xe6f7dd cp_parser_single_declaration
        ../../gcc-trunk/gcc/cp/parser.cc:36504
0xe6fa6b cp_parser_template_declaration_after_parameters
        ../../gcc-trunk/gcc/cp/parser.cc:36157
0xe6fa6b cp_parser_explicit_template_declaration
        ../../gcc-trunk/gcc/cp/parser.cc:36331
0xe80571 cp_parser_declaration
        ../../gcc-trunk/gcc/cp/parser.cc:17595
0xe83628 cp_parser_toplevel_declaration
        ../../gcc-trunk/gcc/cp/parser.cc:17705
0xe83628 cp_parser_translation_unit
        ../../gcc-trunk/gcc/cp/parser.cc:5596
0xe83628 c_parse_file()
        ../../gcc-trunk/gcc/cp/parser.cc:57467
0x1025990 c_common_parse_file()
        ../../gcc-trunk/gcc/c-family/c-opts.cc:1422
/home/syc/gcc-16.0/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1plus -quiet
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE test.cpp -quiet -dumpdir a-
-dumpbase test.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -o
/tmp/ccDp2zF7.s


This only occurs in GCC-trunk.

The test case was generated by a fuzzer.

Reply via email to