diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/desig3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/desig3.C | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/desig3.C b/gcc/testsuite/g++.dg/ext/desig3.C new file mode 100644 index 0000000..d1ff5e5 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/desig3.C @@ -0,0 +1,9 @@ +// PR c++/51229 +// { dg-do compile } +// { dg-options "" } + +struct A { int i; }; + +int a[5] = { .foo = 7 };// { dg-error "used in a GNU-style designated initializer for an array" } +int b[] = { .foo = 8 }; // { dg-error "used in a GNU-style designated initializer for an array" } +A c = { [0] = {} }; // { dg-error "used in a GNU-style designated initializer for class" } |