diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C b/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C new file mode 100644 index 00000000000..39592b26a58 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C @@ -0,0 +1,37 @@ +// PR c++/71442 +// { dg-do compile { target c++11 } } +// { dg-options "-Wunused-variable" } + +struct C +{ + template<typename... Ts> + int operator()(Ts &&...) + { + return sizeof...(Ts); + } +}; + +int +foo () +{ + C {} (1, 1L, 1LL, 1.0); +} + +template<int N> +void +bar () +{ + char a; // { dg-warning "unused variable" } + short b; // { dg-warning "unused variable" } + int c; // { dg-warning "unused variable" } + long d; // { dg-warning "unused variable" } + long long e; // { dg-warning "unused variable" } + float f; // { dg-warning "unused variable" } + double g; // { dg-warning "unused variable" } +} + +void +baz () +{ + bar <0> (); +} |