gcc/testsuite/g++.old-deja/g++.pt/memtemp47.C
raw| 1 | // { dg-do link } |
| 2 | // GROUPS passed templates membertemplates |
| 3 | extern "C" int printf(const char*, ...); |
| 4 | |
| 5 | template <class X> |
| 6 | struct S |
| 7 | { |
| 8 | template <class U> |
| 9 | void g(U u) |
| 10 | { printf ("In S::g(U)\n"); } |
| 11 | |
| 12 | int c[16]; |
| 13 | }; |
| 14 | |
| 15 | |
| 16 | template <class X> |
| 17 | struct T : public S<X> |
| 18 | { |
| 19 | template <class U> |
| 20 | void f(U u) |
| 21 | { printf ("In T::f(U)\n"); this->g(u); } |
| 22 | }; |
| 23 | |
| 24 | int main() |
| 25 | { |
| 26 | T<char*> t; |
| 27 | t.f(3); |
| 28 | t.f("adf"); |
| 29 | } |