2 // { dg-do compile { target c++11 } }
4 template<typename T> T declval();
6 template<typename T, typename U>
8 static const bool value = false;
12 struct is_same<T, T> {
13 static const bool value = true;
22 template<typename U, U> struct helper {};
24 template <typename Z> static auto
25 test(Z z) -> decltype(helper<void (Z::*)() const, &Z::foo>(), true_type());
27 template <typename> static auto test(...) -> false_type;
30 enum { value = is_same<decltype(test<T>(declval<T>())), true_type>::value };
38 struct A1 : public A {};
40 static_assert (is_foo<A>::value == 1, "");
41 static_assert (is_foo<A1>::value == 0, "");