]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp...
authorJakub Jelinek <jakub@redhat.com>
Fri, 22 Jun 2018 20:47:57 +0000 (22:47 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 22 Jun 2018 20:47:57 +0000 (22:47 +0200)
Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

PR c++/84874
* g++.dg/cpp1z/desig8.C: New test.

From-SVN: r261928

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/desig8.C [new file with mode: 0644]

index dbb4a96a6951b2d9db67f51d77076fa03f438ad0..0a2d4686ff6052ce68688fea61088e1216e7e391 100644 (file)
@@ -3,6 +3,9 @@
        Backported from mainline
        2018-03-16  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/84874
+       * g++.dg/cpp1z/desig8.C: New test.
+
        PR tree-optimization/84841
        * gcc.dg/pr84841.c: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp1z/desig8.C b/gcc/testsuite/g++.dg/cpp1z/desig8.C
new file mode 100644 (file)
index 0000000..a6fc160
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/84874
+// { dg-do compile { target c++1z } }
+// { dg-options "" }
+
+struct A { int a; struct { int b; }; };
+struct B { A d; };
+
+void
+foo (B *x)
+{
+  *x = { .d = { .b = 5 } };    // { dg-message "non-trivial designated initializers not supported" }
+}
+
+void
+bar (A *x)
+{
+  *x = { .b = 6 };             // { dg-message "non-trivial designated initializers not supported" }
+}