2 // { dg-do compile { target c++11 } }
8 constexpr static int test(...) {
13 constexpr static int test(decltype(sizeof(C::x))) { // Doesn't compile.
14 return 1; // Is a member variable.
17 template <typename C, int c = sizeof(decltype(((C*)nullptr)->x()))>
18 constexpr static int test(int) {
19 return 2; // Is a member function.
22 static const int value = test<T>(0);
33 static_assert(has<int>::value == 0, "");
34 static_assert(has<foo>::value == 1, "");
35 static_assert(has<bar>::value == 2, "");