1 // PR c++/21682 2 3 template <class T> 4 struct t 5 { 6 typedef typename T::type type; 7 }; 8 template<> class t<int>{}; 9 10 template <class T> struct t1{ }; 11 template<> struct t1<int> 12 { 13 typedef int type; 14 }; 15 16 namespace name1 17 { 18 template <class S> typename t<S>::type begin(S const& s); 19 namespace name2 20 { 21 template <class S> typename t1<S>::type begin(S const& s); 22 } 23 using name2::begin; 24 } 25 26 /* Test calling the function. */ 27 int f(int a) { return name1::begin(a); } 28 29 struct aa { typedef double type; }; 30 double g(aa t) { return name1::begin(t); } 31