From: Jason Merrill Date: Fri, 26 Jun 2015 20:33:35 +0000 (-0400) Subject: re PR c++/66654 (ice in digest_init_r, at cp/typeck2.c:1103) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7457279bae2d1ba50848d95f5b927a599e194646;p=gcc.git re PR c++/66654 (ice in digest_init_r, at cp/typeck2.c:1103) PR c++/66654 * typeck2.c (digest_init_r): Only expect reshaping if the class is aggregate. From-SVN: r225082 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4d8ec3eed00..6324dff3a2d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-06-26 Jason Merrill + + PR c++/66654 + * typeck2.c (digest_init_r): Only expect reshaping if the class is + aggregate. + 2015-06-26 Marek Polacek * cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P. diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 30d93ed39fa..7597de1158a 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1095,7 +1095,8 @@ digest_init_r (tree type, tree init, bool nested, int flags, if (cxx_dialect >= cxx11 && BRACE_ENCLOSED_INITIALIZER_P (init) && CONSTRUCTOR_NELTS (init) == 1 - && (CLASS_TYPE_P (type) || VECTOR_TYPE_P (type))) + && ((CLASS_TYPE_P (type) && !CLASSTYPE_NON_AGGREGATE (type)) + || VECTOR_TYPE_P (type))) { tree elt = CONSTRUCTOR_ELT (init, 0)->value; if (reference_related_p (type, TREE_TYPE (elt))) diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-list4.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list4.C new file mode 100644 index 00000000000..fe5be07c9df --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list4.C @@ -0,0 +1,9 @@ +// PR c++/66654 +// { dg-do compile { target c++11 } } + +class A { + A(); +}; +class B { + A r{r}; +};