This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57419] New: Access control doesn't stop referring to a deleted function
- From: "potswa at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 26 May 2013 07:03:59 +0000
- Subject: [Bug c++/57419] New: Access control doesn't stop referring to a deleted function
- Auto-submitted: auto-generated
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" );