gcc/testsuite/g++.old-deja/g++.pt/crash18.C
raw| 1 | // { dg-do link } |
| 2 | |
| 3 | template<class T> |
| 4 | class foo { |
| 5 | T deft; |
| 6 | |
| 7 | template<class U> int priv (U u, T t) { return u - t; } |
| 8 | public: |
| 9 | foo (T t) : deft (t) {} |
| 10 | |
| 11 | template<class U> int pub (U u) { |
| 12 | int (foo::*fn) (U, T); |
| 13 | fn = &foo<T>::template priv<U>; |
| 14 | return (this->*fn) (u, deft); |
| 15 | } |
| 16 | }; |
| 17 | |
| 18 | int |
| 19 | main () |
| 20 | { |
| 21 | foo<long> fff (5); |
| 22 | return fff.pub (3); |
| 23 | } |