+2011-03-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/48132
+ * decl.c (check_array_designated_initializer): Allow integer index.
+ (reshape_init_array_1): Set index on the elements.
+
2011-03-16 Jason Merrill <jason@redhat.com>
PR c++/48113
if (ce->index == error_mark_node)
error ("name used in a GNU-style designated "
"initializer for an array");
+ else if (TREE_CODE (ce->index) == INTEGER_CST)
+ /* An index added by reshape_init. */
+ return true;
else
{
gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE);
elt_init = reshape_init_r (elt_type, d, /*first_initializer_p=*/false);
if (elt_init == error_mark_node)
return error_mark_node;
- CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init), NULL_TREE, elt_init);
+ CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init),
+ size_int (index), elt_init);
}
return new_init;
+2011-03-16 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-array3.C: New.
+
2011-03-16 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae6.C: New.