This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFH / Patch] PR 54191
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Wed, 08 Aug 2012 13:57:56 +0200
- Subject: Re: [RFH / Patch] PR 54191
- References: <50215C50.2080708@oracle.com>
.. 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.