gcc/testsuite/g++.dg/warn/Wredundant-decls-spec.C
raw| 1 | // PR c++/15867 |
| 2 | // { dg-options -Wredundant-decls } |
| 3 | |
| 4 | template <typename T> struct S |
| 5 | { |
| 6 | void foo() {} |
| 7 | }; |
| 8 | |
| 9 | template<> void S<int>::foo(); |
| 10 | |
| 11 | template<> void S<double>::foo(); // { dg-message "previous declaration" } |
| 12 | template<> void S<double>::foo(); // { dg-warning "redundant redeclaration" } |