aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-06-26 16:33:35 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-06-26 16:33:35 -0400
commit7457279bae2d1ba50848d95f5b927a599e194646 (patch)
tree57d2140eb3af094ea4e1ad70b9190d1b6eed6430 /gcc
parenta2b5fdcbdb0c8001c4cd2274ddff1a6c4fa7e4b3 (diff)
downloadgcc-7457279bae2d1ba50848d95f5b927a599e194646.zip
gcc-7457279bae2d1ba50848d95f5b927a599e194646.tar.gz
gcc-7457279bae2d1ba50848d95f5b927a599e194646.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck2.c3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-list4.C9
3 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4d8ec3e..6324dff 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 30d93ed..7597de1 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 0000000..fe5be07
--- /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};
+};