gcc/testsuite/g++.dg/template/spec7.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // PR c++/6440: Specialization of member class template. |
| 4 | |
| 5 | template<class T> struct A |
| 6 | { |
| 7 | template<class U> struct B {}; |
| 8 | }; |
| 9 | |
| 10 | template<> template<class U> |
| 11 | struct A<int>::B |
| 12 | { |
| 13 | void f(); |
| 14 | template <class V> void g(V); |
| 15 | }; |
| 16 | |
| 17 | template<> template<> template <class V> void A<int>::B<char>::g(V) |
| 18 | { |
| 19 | } |
| 20 | |
| 21 | A<int>::B<char> b; |
| 22 | |
| 23 | void h() |
| 24 | { |
| 25 | b.f(); |
| 26 | b.g(0); |
| 27 | } |