From: Jason Merrill Date: Tue, 14 Jul 2015 17:35:38 +0000 (-0400) Subject: * call.c (build_new_method_call_1): Call reshape_init. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e056dfd06a163af1204b2af5b7e44322a3e39cd1;p=gcc.git * call.c (build_new_method_call_1): Call reshape_init. From-SVN: r225784 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d2e5502f4c8..904fc76386f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2015-07-14 Jason Merrill + + * call.c (build_new_method_call_1): Call reshape_init. + 2015-07-14 Paolo Carlini * pt.c (check_template_shadow): Emit error + inform instead of diff --git a/gcc/cp/call.c b/gcc/cp/call.c index fce42da4126..8dda1deeb8c 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -8069,7 +8069,10 @@ build_new_method_call_1 (tree instance, tree fns, vec **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 index 00000000000..e880486bfb5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist-new1.C @@ -0,0 +1,12 @@ +// { dg-do compile { target c++11 } } + +struct A +{ + A() = default; + A(const A&) = default; +}; + +void f() +{ + new A{A()}; +}