]> 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>
Mon, 25 Jun 2018 17:34:18 +0000 (19:34 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:34:18 +0000 (19:34 +0200)
Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

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

From-SVN: r262078

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

index 65efe2139901987cf5be9c793bb9436620653174..a379993397326c8bdd325ea2b7db3e5caadeaca5 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 c++/84874
        * g++.dg/cpp1z/desig7.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" }
+}