OSDN Git Service

PR middle-end/52419
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / Wcxx-compat-20.c
1 /* { dg-do compile } */
2 /* { dg-options "-Wc++-compat" } */
3 typedef struct s { const int i; } s; /* { dg-message "should be initialized" } */
4 union u {const int a; double b;}; /* { dg-message "should be initialized" } */
5 struct ts { int a; s v;};
6 struct ta { int a; s v[2];};
7
8 void f ()
9 {
10   s v1; /* { dg-warning "uninitialized const member in" } */
11   s va[2]; /* { dg-warning "uninitialized const member in" } */
12   union u v2; /* { dg-warning "uninitialized const member in" } */ 
13   struct ts v3; /* { dg-warning "uninitialized const member in" } */
14   struct ta ta[2]; /* { dg-warning "uninitialized const member in" } */
15