+2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/65815
+ * typeck2.c (digest_nsdmi_init): On aggregates use reshape_init.
+ * init.c (expand_default_init): Likewise.
+
2015-06-09 Jason Merrill <jason@redhat.com>
PR c++/66383
&& CP_AGGREGATE_TYPE_P (type))
/* A brace-enclosed initializer for an aggregate. In C++0x this can
happen for direct-initialization, too. */
- init = digest_init (type, init, complain);
+ {
+ init = reshape_init (type, init, complain);
+ init = digest_init (type, init, complain);
+ }
/* A CONSTRUCTOR of the target's type is a previously digested
initializer, whether that happened just above or in
{
gcc_assert (TREE_CODE (decl) == FIELD_DECL);
+ tree type = TREE_TYPE (decl);
int flags = LOOKUP_IMPLICIT;
if (DIRECT_LIST_INIT_P (init))
flags = LOOKUP_NORMAL;
- init = digest_init_flags (TREE_TYPE (decl), init, flags);
+ if (BRACE_ENCLOSED_INITIALIZER_P (init)
+ && CP_AGGREGATE_TYPE_P (type))
+ init = reshape_init (type, init, tf_warning_or_error);
+ init = digest_init_flags (type, init, flags);
if (TREE_CODE (init) == TARGET_EXPR)
/* This represents the whole initialization. */
TARGET_EXPR_DIRECT_INIT_P (init) = true;
+2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/65815
+ * g++.dg/cpp0x/nsdmi-aggr1.C: New.
+ * g++.dg/cpp0x/mem-init-aggr1.C: Likewise.
+
2015-06-09 Marek Polacek <polacek@redhat.com>
PR tree-optimization/66299
--- /dev/null
+// PR c++/65815
+// { dg-do compile { target c++11 } }
+
+struct array {
+ int data [2];
+};
+
+struct X : array {
+ X() : array{ 1, 2 } { }
+};
--- /dev/null
+// PR c++/65815
+// { dg-do compile { target c++11 } }
+
+struct array {
+ int data [2];
+};
+
+struct X {
+ array a = { 1, 2 };
+};