The case of an initializer with side effects for a zero-length array seems
extremely unlikely, but we should still return the right type in that case.
PR c++/101029
gcc/cp/ChangeLog:
* init.c (build_vec_init): Preserve the type of base.
{
/* Shortcut zero element case to avoid unneeded constructor synthesis. */
if (init && TREE_SIDE_EFFECTS (init))
- base = build2 (COMPOUND_EXPR, void_type_node, init, base);
+ base = build2 (COMPOUND_EXPR, ptype, init, base);
return base;
}