// PR c++/56970 // { dg-do compile { target c++11 } } template struct has { template constexpr static int test(...) { return 0; } template constexpr static int test(decltype(sizeof(C::x))) { // Doesn't compile. return 1; // Is a member variable. } template x()))> constexpr static int test(int) { return 2; // Is a member function. } static const int value = test(0); }; struct foo { int x; }; struct bar { int x(); }; static_assert(has::value == 0, ""); static_assert(has::value == 1, ""); static_assert(has::value == 2, "");