gcc/testsuite/g++.dg/template/spec42.C
raw| 1 | // PR c++/115716 |
| 2 | // { dg-do compile } |
| 3 | template <typename T> struct x { |
| 4 | template <typename U> struct y { // { dg-note "used 1 template parameter" } |
| 5 | typedef T result2; |
| 6 | }; |
| 7 | }; |
| 8 | |
| 9 | template<> |
| 10 | template<typename U, typename> |
| 11 | struct x<int>::y { // { dg-error "redeclared with 2 template parameters" } |
| 12 | typedef double result2; |
| 13 | }; |
| 14 | |
| 15 | int main() { |
| 16 | x<int>::y<int>::result2 xxx2; |
| 17 | } |