PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-parm-2.C
blobd4276c0a2cd6be94e5cc4d5e081d0ba5495adc0e
1 // { dg-do compile }
2 // { dg-options "-Wunused -W" }
4 template <int N>
5 long
6 f1 (unsigned long long x)
8   unsigned long long a = 1;
9   const union { unsigned long long l; unsigned int p[2]; } b = { x };
10   const union { unsigned long long l; unsigned int p[2]; } c = { a };
11   return b.p[0] + c.p[0];
14 template <int N>
15 int
16 f2 (int x, int y)
18   int a = 1;
19   int b[] = { 1, 2, x, a, 3, 4 };
20   return b[y];
23 template <int N>
24 int
25 f3 (int a)      // { dg-warning "unused parameter" }
27   return 0;
30 template <int N>
31 int
32 f4 (int a)      // { dg-warning "set but not used" }
34   a = 1;
35   return 0;
38 template <int N>
39 int
40 f5 (int a)
42   a = 1;
43   return a;
46 void
47 test ()
49   (void) f1<0> (0);
50   (void) f2<0> (0, 0);
51   (void) f3<0> (0);
52   (void) f4<0> (0);
53   (void) f5<0> (0);