gcc/testsuite/g++.dg/warn/Wunused-var-1.C
raw| 1 | // { dg-options "-Wunused" } |
| 2 | template <int> struct X { static const int s = 2; }; |
| 3 | template <typename T> int f() { const int v = 2; return X<v+1>::s; } |
| 4 | template <typename T> int g() { const int v = 2; return X<v>::s; } |
| 5 | template <typename T> int h() { const int v = 2; return X<1 ? v : 0>::s; } |
| 6 | template int f<int>(); |
| 7 | template int g<int>(); |
| 8 | template int h<int>(); |