// PR c++/61806 // { dg-do compile { target c++11 } } struct true_type { static const bool value = true; }; struct false_type { static const bool value = false; }; template T&& declval(); template struct check { typedef void type; }; template struct has_public_f : false_type {}; template struct has_public_f< T, typename check< decltype( declval().f() ) >::type > : true_type {}; struct Spub { public: void f(); }; struct Spriv { private: void f(); }; static_assert( has_public_f::value, "Ouch"); static_assert(!has_public_f::value, "Ouch"); int main() {}