* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / variadic143.C
blobdb0b268e4bd454263b944360dc0308539f670364
1 // PR c++/56782
2 // { dg-do compile { target c++11 } }
4 template<class T>
5 T&& declval();
7 struct is_convertible_impl {
8   template<class T>
9   static void sink(T);
11   template<class T, class U, class = decltype(sink<U>(declval<T>()))>
12   static auto test(int) -> char;
14   template<class, class>
15   static auto test(...) -> char(&)[2];
18 template<class T, class U>
19 struct is_convertible : is_convertible_impl
21   static const bool value = sizeof(test<T, U>(0)) == 1;
24 template<bool, class>
25 struct enable_if {};
27 template<class T>
28 struct enable_if<true, T> { typedef T type; };
30 template<bool, class If, class Else>
31 struct conditional { typedef If type; };
33 template<class If, class Else>
34 struct conditional<false, If, Else> { typedef Else type; };
36 template<class...>
37 struct and_;
39 template<>
40 struct and_<>
42   static const bool value = true;
45 template<class P>
46 struct and_<P> : P
50 template<class P1, class P2>
51 struct and_<P1, P2> : conditional<P1::value, P2, P1>::type
55 template<class... T>
56 struct Tuple {
57   template<class... U,
58            class = typename enable_if<and_<is_convertible<U, T>... >::value, int>::type
59            >
60   Tuple(U&&...){}
63 static_assert(is_convertible<Tuple<>, Tuple<>>::value, "Ouch"); //#1