Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-var-4.C
blob11ed7afea55eb83506c89e050e3e108ae5fa813b
1 /* { dg-do compile } */
2 /* { dg-options "-Wunused" } */
4 struct S { int e; };
6 int
7 f1 (void)
9   int a;
10   int b;
11   int c;
12   int d;
13   S s;
14   a = 1;
15   b = 2;
16   c = 3;
17   d = 4;
18   s.e = 5;
19   __typeof (c) e;       // { dg-warning "set but not used" }
20   __decltype (d) f;     // { dg-warning "set but not used" }
21   __decltype (s.e) g;   // { dg-warning "set but not used" }
22   e = 1;
23   f = 1;
24   g = 1;
25   return sizeof (a) + __alignof__ (b);
28 template <int N>
29 int f2 (void)
31   int a;
32   int b;
33   int c;
34   int d;
35   a = 1;
36   b = 2;
37   c = 3;
38   d = 4;
39   __typeof (c) e;       // { dg-warning "set but not used" }
40   __decltype (d) f;     // { dg-warning "set but not used" }
41   e = 1;
42   f = 1;
43   return sizeof (a) + __alignof__ (b);
46 void
47 test (void)
49   (void) f2<0> ();