This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48530] New: [C++0x][SFINAE] Hard errors with deleted d'tors
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 9 Apr 2011 16:56:40 +0000
- Subject: [Bug c++/48530] New: [C++0x][SFINAE] Hard errors with deleted d'tors
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48530
Summary: [C++0x][SFINAE] Hard errors with deleted d'tors
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
CC: jason@redhat.com
The following program in C++0x mode is not well-formed, but should be:
template<class T,
class = decltype(T())
>
char f(int);
template<class>
char (&f(...))[2];
struct DelDtor {
~DelDtor() = delete;
};
static_assert(sizeof(f<DelDtor>(0)) != 1, "Error");
"error: use of deleted function âDelDtor::~DelDtor()â"
Note: This should be a case where the revised decltype rules in regard to
complete types would not apply, so it should be well-formed even after
implementing this new rule.