[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / desig2.C
blob7a036182062767a7a1e4d46f902904c65e726442
1 // { dg-do compile }
2 // { dg-options "" }
4 struct S { int a, b, c; };
6 S a = { 1, 2, 3 };
7 S b = { .a = 1, .b = 2, .c = 3 };
8 S c = { 1, .b = 2, .c = 3 };    // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++2a } }
9 S d = { .a = 1, 2, 3 };         // { dg-error "either all initializer clauses should be designated or none of them should be" "" { target c++2a } }
10 S e = { .b = 1, .b = 2 };       // { dg-error "designator used multiple times in the same initializer list" }
12 #if __cplusplus > 201103L
13 template <int... N>
14 void
15 foo ()
17   S f = { .a = N... };          // { dg-error "'...' not allowed in designated initializer list" "" { target c++2a } }
19 #endif