// PR c++/95143 // { dg-do compile { target c++11 } } struct false_type { static constexpr bool value = false; }; struct true_type{ static constexpr bool value = true; }; template T&& declval() noexcept; template struct is_static_castable : false_type {}; template struct is_static_castable(declval()))> : true_type {}; class Base { }; struct A { }; class B: public Base { }; int main() { constexpr auto canCast = is_static_castable::value; static_assert(!canCast, ""); constexpr auto canCast2 = is_static_castable::value; static_assert(canCast2, ""); }