.. I'm coming to the conclusion that the tests which are not fixed by a patch along the lines of my draft don't have much to do with SFINAE vs inaccessible bases per se (with the possible exception of the conditional operator case). Consider:

struct A
{};

struct B
{};

template<typename T>
T &&declval();

template<typename From, typename = decltype(B{declval<From>()})>
constexpr bool test_braced_cast_to_base(int)
{ return true; }

template<typename>
constexpr bool test_braced_cast_to_base(bool)
{ return false; }

static_assert(!test_braced_cast_to_base<A>(0), "");

this also triggers the static_assert. Really, in 'decltype(B{declval<From>()})' almost *everything* is Ok between the curly brackets. Maybe we should have a separate PR for this.

Paolo.

Reply via email to