This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFH / Patch] PR 54191


.. 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]