PR middle-end/77674
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-var-10.C
blobffdb893279070203ac1598d6d927c0324112f480
1 // PR c++/44412
2 // { dg-do compile }
3 // { dg-options "-Wunused" }
5 struct S
7   static const int a = 3;
8   static int b;
9   int c;
12 const int S::a;
13 int S::b = 4;
15 int
16 f1 ()
18   S s;
19   return s.a;
22 int
23 f2 ()
25   S s;
26   return s.b;
29 void
30 f3 ()
32   S s;          // { dg-warning "set but not used" }
33   s.c = 6;
36 int
37 f4 ()
39   S s;
40   s.c = 6;
41   return s.c;