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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We don't ICE with
struct S { int s; } a[1];
but do ICE with e.g.
struct S { constexpr S () {} } a[1];

build_value_init has:
341       /* The AGGR_INIT_EXPR tweaking below breaks in templates.  */
342       gcc_assert (!processing_template_decl
343                   || (SCALAR_TYPE_P (type) || TREE_CODE (type) ==
ARRAY_TYPE));
early, and type in this case is RECORD_TYPE S.
Called from:
2456      /* If it's within the array bounds but doesn't have an explicit
2457         initializer, it's value-initialized.  */
2458      tree val = build_value_init (elem_type, tf_warning_or_error);
2459      return cxx_eval_constant_expression (ctx, val, lval, non_constant_p,
2460                                           overflow_p);
because a doesn't have explicit initializer.
No idea what to do here...

Reply via email to