2013-07-09 Jason Merrill <jason@redhat.com>
+ PR c++/57402
+ * init.c (build_vec_init): Don't take shortcuts when initializing
+ a VLA.
+
PR c++/57471
* parser.c (cp_parser_sizeof_pack): Clear parser scopes.
if (init
&& TREE_CODE (atype) == ARRAY_TYPE
+ && TREE_CONSTANT (maxindex)
&& (from_array == 2
? (!CLASS_TYPE_P (inner_elt_type)
|| !TYPE_HAS_COMPLEX_COPY_ASSIGN (inner_elt_type))
tree field, elt;
/* Should we try to create a constant initializer? */
bool try_const = (TREE_CODE (atype) == ARRAY_TYPE
+ && TREE_CONSTANT (maxindex)
&& (literal_type_p (inner_elt_type)
|| TYPE_HAS_CONSTEXPR_CTOR (inner_elt_type)));
/* If the constructor already has the array type, it's been through
/* Clear out INIT so that we don't get confused below. */
init = NULL_TREE;
+ /* Any elements without explicit initializers get {}. */
+ explicit_value_init_p = true;
}
else if (from_array)
{