2 // { dg-do compile { target c++11 } }
15 template<typename From, typename = decltype(B{declval<From>()})>
16 constexpr bool test_braced_cast_to_base(int)
20 constexpr bool test_braced_cast_to_base(bool)
23 static_assert(!test_braced_cast_to_base<D>(0), "");
26 template<typename From, typename = decltype(D{declval<From>()})>
27 constexpr bool test_braced_cast_to_derived(int)
31 constexpr bool test_braced_cast_to_derived(bool)
34 static_assert(!test_braced_cast_to_derived<B>(0), "");
39 template<typename From, typename = decltype(PB{declval<From>()})>
40 constexpr bool test_braced_cast_to_ptr_to_base(int)
44 constexpr bool test_braced_cast_to_ptr_to_base(bool)
47 static_assert(!test_braced_cast_to_ptr_to_base<D *>(0), "");
52 template<typename From, typename = decltype(PD{declval<From>()})>
53 constexpr bool test_braced_cast_to_ptr_to_derived(int)
57 constexpr bool test_braced_cast_to_ptr_to_derived(bool)
60 static_assert(!test_braced_cast_to_ptr_to_derived<B *>(0), "");
63 template<typename From, typename To,
64 typename = decltype(static_cast<To>(declval<From>()))>
65 constexpr bool test_static_cast(int)
68 template<typename, typename>
69 constexpr bool test_static_cast(bool)
72 static_assert(!test_static_cast<B &, D &>(0), "");
73 static_assert(!test_static_cast<B *, D *>(0), "");
76 template<typename From, typename To,
77 typename = decltype(dynamic_cast<To>(declval<From>()))>
78 constexpr bool test_dynamic_cast(int)
81 template<typename, typename>
82 constexpr bool test_dynamic_cast(bool)
85 static_assert(!test_dynamic_cast<D &, B &>(0), "");
86 static_assert(!test_dynamic_cast<D *, B *>(0), "");
91 template<typename T, typename = decltype(declval<T>().*pm)>
92 constexpr bool test_member_ptr_dot(int)
96 constexpr bool test_member_ptr_dot(bool)
99 static_assert(!test_member_ptr_dot<D>(0), "");
102 template<typename T, typename = decltype(declval<T>()->*pm)>
103 constexpr bool test_member_ptr_arrow(int)
107 constexpr bool test_member_ptr_arrow(bool)
110 static_assert(!test_member_ptr_arrow<D *>(0), "");
113 template<typename T, typename U,
114 typename = decltype(declval<T>() < declval<U>())>
115 constexpr bool test_rel_op(int)
118 template<typename, typename>
119 constexpr bool test_rel_op(bool)
122 static_assert(!test_rel_op<D *, B *>(0), "");
125 template<typename T, typename U,
126 typename = decltype(declval<T>() == declval<U>())>
127 constexpr bool test_eq(int)
130 template<typename, typename>
131 constexpr bool test_eq(bool)
134 static_assert(!test_eq<D *, B *>(0), "");
137 template<typename T, typename U,
138 typename = decltype(false ? declval<T>() : declval<U>())>
139 constexpr bool test_cond_op(int)
142 template<typename, typename>
143 constexpr bool test_cond_op(bool)
146 static_assert(!test_cond_op<B *, D *>(0), "");