1// PR c++/21682
2
3template <class T>
4struct t
5{
6  typedef typename T::type type;
7};
8template<> class t<int>{};
9
10template <class T> struct t1{ };
11template<> struct t1<int>
12{
13  typedef int type;
14};
15
16namespace 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. */
27int f(int a) { return name1::begin(a); }
28
29struct aa { typedef double type; };
30double g(aa t) { return name1::begin(t); }
31