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

            Bug ID: 104284
           Summary: [9/10/11/12 Regression] ICE: unexpected expression
                    '<anonymous>' of kind implicit_conv_expr
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dani at danielbertalan dot dev
  Target Milestone: ---

Godbolt link: https://godbolt.org/z/8bTPra5jK

The following code snippet causes an ICE on trunk (commit
3d41939c8799a51b1cd7f4610c06771bf6d52f15), and as far back as on 9.1 with
-fchecking=2:

---
struct EstablishedTiming {
    char m_dmt_id{};
};

auto x = [](auto) { constexpr EstablishedTiming
established_timings3_bytes[]{{}}; };
---

ice1.ii: In lambda function:
ice1.ii:5:80: internal compiler error: unexpected expression '<anonymous>' of
kind implicit_conv_expr
    5 | x = [](auto) { constexpr EstablishedTiming
established_timings3_bytes[]{{}}; };
      |                                                                        
  ^

0x98a181 cxx_eval_constant_expression
        gcc/cp/constexpr.cc:7493
0x99109b cxx_eval_store_expression
        gcc/cp/constexpr.cc:5619
0x9860b4 cxx_eval_constant_expression
        gcc/cp/constexpr.cc:6763
0x98a626 cxx_eval_outermost_constant_expr
        gcc/cp/constexpr.cc:7707
0x98f770 fold_non_dependent_expr_template
        gcc/cp/constexpr.cc:8066
0xb0de7f build_non_dependent_expr(tree_node*)
        gcc/cp/pt.cc:28412
0xb6c547 finish_expr_stmt(tree_node*)
        gcc/cp/semantics.cc:870
0xa2d933 get_temp_regvar(tree_node*, tree_node*)
        gcc/cp/init.cc:4254
0xa2d933 build_vec_init(tree_node*, tree_node*, tree_node*, bool, int, int,
vec<tree_node*, va_gc, vl_embed>**)
        gcc/cp/init.cc:4477
0xa2f503 build_aggr_init(tree_node*, tree_node*, int, int)
        gcc/cp/init.cc:2009
0x9d83ec build_aggr_init_full_exprs
        gcc/cp/decl.cc:7053
0x9d83ec check_initializer
        gcc/cp/decl.cc:7214
0x9fdc7f cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        gcc/cp/decl.cc:8108
0xaf15df cp_parser_init_declarator
        gcc/cp/parser.cc:22823
0xacb5e3 cp_parser_simple_declaration
        gcc/cp/parser.cc:15286
0xacd2fd cp_parser_declaration_statement
        gcc/cp/parser.cc:14367
0xacdaeb cp_parser_statement
        gcc/cp/parser.cc:12452
0xace9bd cp_parser_statement_seq_opt
        gcc/cp/parser.cc:12856
0xacea98 cp_parser_compound_statement
        gcc/cp/parser.cc:12808
0xacf797 cp_parser_function_body
        gcc/cp/parser.cc:25062

Reply via email to