Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-var-36.C
blobde338f8f6dd9923c3c7b67b21961f6ab558c8f56
1 // PR c++/92666
2 // { dg-do compile }
3 // { dg-options "-Wunused-but-set-variable" }
5 int bar (int, ...);
6 #if __cplusplus >= 201103L
7 enum class E : int { F = 0, G = 1 };
8 #endif
9 struct S { int s; };
11 void
12 foo ()
14   float r = 1.0f;                       // { dg-bogus "set but not used" }
15   int i = 2;                            // { dg-bogus "set but not used" }
16 #if __cplusplus >= 201103L
17   decltype(nullptr) n = nullptr;        // { dg-bogus "set but not used" }
18   E e = E::F;                           // { dg-bogus "set but not used" }
19 #else
20   void *n = (void *) 0;
21   int e = 4;
22 #endif
23   S s = { 3 };                          // { dg-bogus "set but not used" }
24   bar (0, r, i, n, e, s);