Backported from mainline
2018-03-16 Jakub Jelinek <jakub@redhat.com>
PR c++/84874
* g++.dg/cpp1z/desig8.C: New test.
From-SVN: r262078
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.
--- /dev/null
+// 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" }
+}