* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist-explicit-sfinae.C
blob78ec8cbd0b88a5447783f61e7813bd1719696770
1 // { dg-do compile { target c++11 } }
2 template<typename _Tp>
3 _Tp&& declval() noexcept;
5 template<bool b>
6 struct bt {
7     static constexpr bool value = b;
8 };
10 template <typename To_, typename... From_>
11 class my_is_convertible_many {
12   private:
13     template <typename To>
14       struct indirector {
15         indirector(To);
16       };
18     template <typename To, typename... From>
19       struct tag {};
21     template <typename To, typename... From>
22       static auto test(tag<To, From...>)
23       -> decltype(indirector<To>({declval<From>()...}), bt<true>());
24     static auto test(...)
25       -> bt<false>;
27   public:
28     static constexpr bool value = decltype(test(tag<To_, From_...>()))::value;
31 struct A {};
32 struct B {};
33 struct C {};
35 struct Test {
36   Test(A, A);
37   //Test(B, B);
38   explicit Test(C, C);
39 }; 
41 int main() {    
42   static_assert(my_is_convertible_many<Test, A, A>::value,""); // true, correct
43   static_assert(!my_is_convertible_many<Test, B, B>::value,""); // false, correct
44   static_assert(!my_is_convertible_many<Test, C, C>::value,""); // error
45   return 0;