* 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 d2e5502f4c8bf5185b852d40b3a64f221c2d3bb3..904fc76386fedb210768fd4ba0c8f7eb65130410 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 fce42da41269ef47ea8683e5ddcc35cfe197cd91..8dda1deeb8cc24baad1d8c1b7ea9f319f48c98b5 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()};
+}