commit 59b7dc8ddf4fdd1505a436dbc4de0499fff9aa41
Author: Jason Merrill <jason@redhat.com>
Date: Fri Jan 23 09:39:53 2015 -0500
PR c++/64314
PR c++/57510
* typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
that has been completely split out.
@@ -653,6 +653,8 @@ split_nonconstant_init_1 (tree dest, tree init)
if (!split_nonconstant_init_1 (sub, value))
complete_p = false;
+ else
+ CONSTRUCTOR_ELTS (init)->ordered_remove (idx--);
num_split_elts++;
}
else if (!initializer_constant_valid_p (value, inner_type))
new file mode 100644
@@ -0,0 +1,8 @@
+// PR c++/64314
+// { dg-do compile { target c++11 } }
+
+struct C { C(); ~C(); };
+struct A {
+ int i;
+ C c[1];
+} a {};