summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/variadic116.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/variadic116.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic116.C32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic116.C b/gcc/testsuite/g++.dg/cpp0x/variadic116.C
new file mode 100644
index 000000000..079d751cb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic116.C
@@ -0,0 +1,32 @@
+// Origin: PR c++/48320
+// { dg-options -std=c++0x }
+
+template<class... T>
+struct tuple
+{
+ typedef int type;
+};
+
+template<int... Indices>
+struct indices
+{
+};
+
+template<unsigned i, class Tuple>
+struct tuple_element
+{
+ typedef Tuple type;
+};
+
+template<class Tuple,
+ int... Indices,
+ class Result = tuple<typename tuple_element<Indices, Tuple>::type...> >
+Result
+f(Tuple&&, indices<Indices...>);
+
+
+void
+foo()
+{
+ f(tuple<int, char, unsigned> (), indices<2, 1, 0> ());
+}