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

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
One more test-case:

$ cat ice.ii
struct c {
  int b;
};
struct e : c {
  constexpr e() : c{} {}
};
using d = e;
const int &a((2, d{}).b);

$ g++ ice.ii -c
ice.ii:8:24: internal compiler error: in build_target_expr_with_type, at
cp/tree.c:793
    8 | const int &a((2, d{}).b);
      |                        ^
0x67a78d build_target_expr_with_type(tree_node*, tree_node*, int)
        ../../gcc/cp/tree.c:793
0x887963 cxx_eval_outermost_constant_expr
        ../../gcc/cp/constexpr.c:5110
0x88accc maybe_constant_init_1
        ../../gcc/cp/constexpr.c:5371
0x859d10 set_up_extended_ref_temp
        ../../gcc/cp/call.c:11144
0x859d10 extend_ref_init_temps_1
        ../../gcc/cp/call.c:11304
0xa217f7 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/cp/typeck2.c:815
0x8b334d check_initializer
        ../../gcc/cp/decl.c:6486
0x8cb79c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/cp/decl.c:7162
0x96776b cp_parser_init_declarator
        ../../gcc/cp/parser.c:20033
0x96f203 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13219
0x974262 cp_parser_declaration
        ../../gcc/cp/parser.c:12916
0x974a0c cp_parser_translation_unit
        ../../gcc/cp/parser.c:4668
0x974a0c c_parse_file()
        ../../gcc/cp/parser.c:39266
0xa77000 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1150

Reply via email to