OSDN Git Service

PR c++/6057
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / variadic116.C
1 // Origin: PR c++/48320
2 // { dg-options -std=c++0x }
3
4 template<class... T>
5 struct tuple
6 {
7     typedef int type;
8 };
9
10 template<int... Indices>
11 struct indices
12 {
13 };
14
15 template<unsigned i, class Tuple>
16 struct tuple_element
17 {
18     typedef Tuple type;
19 };
20
21 template<class Tuple,
22          int... Indices,
23          class Result = tuple<typename tuple_element<Indices, Tuple>::type...> >
24 Result
25 f(Tuple&&, indices<Indices...>);
26
27
28 void
29 foo()
30 {
31     f(tuple<int, char, unsigned> (), indices<2, 1, 0> ());
32 }