]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/66654
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Jun 2015 20:33:35 +0000 (20:33 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Jun 2015 20:33:35 +0000 (20:33 +0000)
* typeck2.c (digest_init_r): Only expect reshaping if the class is
aggregate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225082 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/typeck2.c
gcc/testsuite/g++.dg/cpp0x/nsdmi-list4.C [new file with mode: 0644]

index 4d8ec3eed002cc60cd651e363f0489b4b8aeaaf9..6324dff3a2da2b7e461b027e354398e49f839809 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/66654
+       * typeck2.c (digest_init_r): Only expect reshaping if the class is
+       aggregate.
+
 2015-06-26  Marek Polacek  <polacek@redhat.com>
 
        * cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P.
index 30d93ed39faab32f7431ca0c6d9183ac61f1bd90..7597de1158a78f8b637bef38eb9a4bf32a6813a4 100644 (file)
@@ -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 (file)
index 0000000..fe5be07
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/66654
+// { dg-do compile { target c++11 } }
+
+class A {
+  A();
+};
+class B {
+  A r{r};
+};