aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/using24.C
blob: c3cdf93ec9b702a58cefc9d611adad45a743ca2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// PR c++/21682

template <class T>
struct t
{
  typedef typename T::type type;
};
template<> class t<int>{};

template <class T> struct t1{ };
template<> struct t1<int>
{
  typedef int type;
};

namespace name1
{
  template <class S> typename t<S>::type begin(S const& s);
  namespace name2
  {
    template <class S> typename t1<S>::type begin(S const& s);
  }
  using name2::begin;
}

/* Test calling the function. */
int f(int a) { return name1::begin(a); }

struct aa { typedef double type; };
double g(aa t) { return name1::begin(t); }