1 /* Test empty initializers diagnosed in C2X mode with -Wc11-c2x-compat. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c2x -Wc11-c2x-compat" } */
6 struct s s = {}; /* { dg-warning "empty initializer" } */
7 int x = {}; /* { dg-warning "empty initializer" } */
8 float y = {}; /* { dg-warning "empty initializer" } */
9 void *p = {}; /* { dg-warning "empty initializer" } */
10 union u { int a; long b; };
11 union u z = {}; /* { dg-warning "empty initializer" } */
12 int aa[2] = {}; /* { dg-warning "empty initializer" } */
17 int vla[a] = {}; /* { dg-warning "empty initializer" } */
18 struct s as = {}; /* { dg-warning "empty initializer" } */
19 int ax = {}; /* { dg-warning "empty initializer" } */
20 float ay = {}; /* { dg-warning "empty initializer" } */
21 void *ap = {}; /* { dg-warning "empty initializer" } */
22 union u az = {}; /* { dg-warning "empty initializer" } */
23 int aaa[2] = {}; /* { dg-warning "empty initializer" } */
24 int t = (int) {}; /* { dg-warning "empty initializer" } */