* call.c (build_new_method_call_1): Call reshape_init.
authorJason Merrill <jason@redhat.com>
Tue, 14 Jul 2015 17:35:38 +0000 (13:35 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 14 Jul 2015 17:35:38 +0000 (13:35 -0400)
From-SVN: r225784

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/initlist-new1.C [new file with mode: 0644]

index d2e5502..904fc76 100644 (file)
@@ -1,3 +1,7 @@
+2015-07-14  Jason Merrill  <jason@redhat.com>
+
+       * call.c (build_new_method_call_1): Call reshape_init.
+
 2015-07-14  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * pt.c (check_template_shadow): Emit error + inform instead of
index fce42da..8dda1de 100644 (file)
@@ -8069,7 +8069,10 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
       /* If BASETYPE is an aggregate, we need to do aggregate
         initialization.  */
       else if (CP_AGGREGATE_TYPE_P (basetype))
-       init = digest_init (basetype, init_list, complain);
+       {
+         init = reshape_init (basetype, init_list, complain);
+         init = digest_init (basetype, init, complain);
+       }
 
       if (init)
        {
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-new1.C b/gcc/testsuite/g++.dg/cpp0x/initlist-new1.C
new file mode 100644 (file)
index 0000000..e880486
--- /dev/null
@@ -0,0 +1,12 @@
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+  A() = default;
+  A(const A&) = default;
+};
+
+void f()
+{
+  new A{A()};
+}