// PR c++/61083 // { dg-do compile { target c++11 } } template T declval(); template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; struct true_type {}; struct false_type {}; template struct is_foo { private: template struct helper {}; template static auto test(Z z) -> decltype(helper(), true_type()); template static auto test(...) -> false_type; public: enum { value = is_same(declval())), true_type>::value }; }; struct A { int foo(); void foo() const; }; struct A1 : public A {}; static_assert (is_foo::value == 1, ""); static_assert (is_foo::value == 0, "");