1// { dg-do link } 2 3template<class T> 4class foo { 5 T deft; 6 7 template<class U> int priv (U u, T t) { return u - t; } 8public: 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 18int 19main () 20{ 21 foo<long> fff (5); 22 return fff.pub (3); 23} 24