// Source: Comment 16 of PR51213 // { dg-do compile { target c++11 } } template T && declval(); template constexpr auto hasSize(int) -> decltype(declval().size(), bool()) { return true; } template constexpr bool hasSize(...) { return false; } struct A { int size(); }; struct B : private A { }; static_assert(hasSize(0), "A"); static_assert(!hasSize(0), "B");