http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57419

            Bug ID: 57419
           Summary: Access control doesn't stop referring to a deleted
                    function
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: potswa at mac dot com

Using reference-to-member syntax on a private, deleted function in a SFINAE
context fails as a hard error as a use of a deleted function. But it can't be
accessed in the first place due to the access control. Calling the function
instead produces the desired result.

Clang 3.2 accepts this TU but GCC 4.9 rejects:

template< typename q >
decltype( &q::f ) t( q ) {}

char t( ... ) { return {}; }

class c { void f() = delete; };
class d { static void f() = delete; };

static_assert( sizeof( t( c() ) ), "c" );
static_assert( sizeof( t( d() ) ), "d" );

Reply via email to