gcc/testsuite/g++.old-deja/g++.pt/ttp31.C
raw| 1 | // { dg-do run } |
| 2 | template<class T> class D |
| 3 | { |
| 4 | public: |
| 5 | int f(); |
| 6 | }; |
| 7 | |
| 8 | template<class T> int D<T>::f() |
| 9 | { |
| 10 | return sizeof(T); |
| 11 | } |
| 12 | |
| 13 | extern "C" void abort(); |
| 14 | |
| 15 | template<template<class> class D,class E> class C |
| 16 | { |
| 17 | D<E> d; |
| 18 | public: |
| 19 | int f() { abort(); return 0; } |
| 20 | }; |
| 21 | |
| 22 | template<template <class> class F> class C<F,int> |
| 23 | { |
| 24 | F<int> d; |
| 25 | public: |
| 26 | int f() { return d.f(); } |
| 27 | }; |
| 28 | |
| 29 | int main() |
| 30 | { |
| 31 | C<D,int> c; |
| 32 | c.f(); |
| 33 | } |