summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/deduce2.C
blob: bcf77b30b78b5fa5465dc1f6f7966c64eed6a429 (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
template <typename T0> struct tuple {
    typedef tuple<int> tail;
};

template <> struct tuple<int> {
};

template <typename L>
struct length  {
  static const int i = length<typename tuple<L>::tail>::i;
};

template<>
struct length<tuple<int> > {
    static const int i = 1;
};

template <int> struct M {};

template <typename A>
M<length<tuple<A> >::i > foo (A*);

template <typename A>
M<length<tuple<A> >::i> foo (const A*);

const int i1 = 3;

void bar() {
  foo (&i1);
}