Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-var-12.C
blob3300cbe3d8ad5a70e020423c8974aaa8086db4e1
1 // PR c++/44444
2 // { dg-do compile }
3 // { dg-options "-Wunused" }
5 struct S
7   const int &u;
8   const int &v;
9   S (const int &a, const int &b) : u(a), v(b) { }
12 bool
13 f1 ()
15   bool t = false;
16   S z = S (1, 2);
17   t |= z.u == 1;
18   t |= z.v == 2;
19   return t;
22 void
23 f2 ()
25   S z = S (1, 2);
26   z.u;          // { dg-warning "no effect" }
29 int i;
31 void
32 f3 ()
34   S z = S (1, 2);
35   i++, z.u;     // { dg-warning "no effect" }