https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96636
Bug ID: 96636 Summary: ICE in build_value_init_noctor, at cp/init.c:451 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Input: //small.cc typedef class { class a {}; class : virtual a {}; } b; void foo(){ b{};} Command: g++ small.cc Output: small.cc: In function ‘void foo()’: small.cc:5:15: internal compiler error: in build_value_init_noctor, at cp/init.c:451 5 | void foo(){ b{};} | ^ 0x659bfa build_value_init_noctor(tree_node*, int) ../../gcc/cp/init.c:451 0x978b75 build_value_init(tree_node*, int) ../../gcc/cp/init.c:379 0x8adee2 build_new_method_call_1 ../../gcc/cp/call.c:10234 0x8b1b90 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) ../../gcc/cp/call.c:10467 0x8b1b90 build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, int) ../../gcc/cp/call.c:9870 0x8b2134 perform_direct_initialization_if_possible(tree_node*, tree_node*, bool, int) ../../gcc/cp/call.c:11966 0xab5b79 build_static_cast_1 ../../gcc/cp/typeck.c:7481 0xab6f12 cp_build_c_cast(unsigned int, tree_node*, tree_node*, int) ../../gcc/cp/typeck.c:8298 0xac04ed build_functional_cast_1 ../../gcc/cp/typeck2.c:2380 0xac04ed build_functional_cast(unsigned int, tree_node*, tree_node*, int) ../../gcc/cp/typeck2.c:2413 0xa6fda7 finish_compound_literal(tree_node*, tree_node*, int, fcl_t) ../../gcc/cp/semantics.c:2977 0x9cc33a cp_parser_functional_cast ../../gcc/cp/parser.c:29684 0x9e4917 cp_parser_postfix_expression ../../gcc/cp/parser.c:7251 0x9c665a cp_parser_binary_expression ../../gcc/cp/parser.c:9641 0x9c83ee cp_parser_assignment_expression ../../gcc/cp/parser.c:9946 0x9c8712 cp_parser_expression ../../gcc/cp/parser.c:10114 0x9cbdf8 cp_parser_expression_statement ../../gcc/cp/parser.c:11774 0x9d72eb cp_parser_statement ../../gcc/cp/parser.c:11570 0x9d8ccd cp_parser_statement_seq_opt ../../gcc/cp/parser.c:11921 0x9d8da8 cp_parser_compound_statement ../../gcc/cp/parser.c:11871 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Noted that all GCC-5 onwards versions behave the same.