https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106983
Bug ID: 106983 Summary: [12/13 Regression] ICE tree check: expected class 'type', have 'exceptional' (error_mark) in type_build_dtor_call, at cp/class.cc:5794 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started between 20220206 and 20220213 : (gcc configured with --enable-checking=yes) $ cat z1.cc // struct B {int n;}; typedef unsigned long long A; typedef union { struct B s; A a; } U; void f (A x, unsigned int b) { const U y = {.a = x}; } $ g++-13-20220918 -c z1.cc z1.cc:5:12: error: field 's' has incomplete type 'B' 5 | struct B s; | ^ z1.cc:5:10: note: forward declaration of 'struct B' 5 | struct B s; | ^ z1.cc: In function 'void f(A, unsigned int)': z1.cc:10:22: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in type_build_dtor_call, at cp/class.cc:5794 10 | const U y = {.a = x}; | ^ 0x6fc42b tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc/tree.cc:8877 0x82fed0 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc/tree.h:3643 0x82fed0 type_build_dtor_call(tree_node*) ../../gcc/cp/class.cc:5794 0xb49106 split_nonconstant_init_1 ../../gcc/cp/typeck2.cc:600 0xb4ac4b split_nonconstant_init(tree_node*, tree_node*) ../../gcc/cp/typeck2.cc:739 0x8c1c71 check_initializer ../../gcc/cp/decl.cc:7453 0x8f0f4a cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc/cp/decl.cc:8449 0xa244b3 cp_parser_init_declarator ../../gcc/cp/parser.cc:22997 0x9f7d82 cp_parser_simple_declaration ../../gcc/cp/parser.cc:15413 0x9f9939 cp_parser_declaration_statement ../../gcc/cp/parser.cc:14494 0x9f9feb cp_parser_statement ../../gcc/cp/parser.cc:12571 0x9fb114 cp_parser_statement_seq_opt ../../gcc/cp/parser.cc:12983 0x9fb1f7 cp_parser_compound_statement ../../gcc/cp/parser.cc:12935 0xa231a0 cp_parser_function_body ../../gcc/cp/parser.cc:25285 0xa231a0 cp_parser_ctor_initializer_opt_and_function_body ../../gcc/cp/parser.cc:25336 0xa2381a cp_parser_function_definition_after_declarator ../../gcc/cp/parser.cc:31480 0xa24d5c cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/cp/parser.cc:31397 0xa24d5c cp_parser_init_declarator ../../gcc/cp/parser.cc:22735 0x9f7d82 cp_parser_simple_declaration ../../gcc/cp/parser.cc:15413 0xa2c49f cp_parser_declaration ../../gcc/cp/parser.cc:15099