aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/desig8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp1z/desig8.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/desig8.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1z/desig8.C b/gcc/testsuite/g++.dg/cpp1z/desig8.C
new file mode 100644
index 00000000000..a6fc1600f5a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/desig8.C
@@ -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" }
+}