This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52659] New: GCC fails to reject a deleted function definition which is not the first declaration
- From: "illissius at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Mar 2012 22:42:00 +0000
- Subject: [Bug c++/52659] New: GCC fails to reject a deleted function definition which is not the first declaration
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52659
Bug #: 52659
Summary: GCC fails to reject a deleted function definition
which is not the first declaration
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: illissius@gmail.com
C++11 8.4.3.4:
"A deleted deïnition of a function shall be the ïrst declaration of the
function or, for an explicit specialization of a function template, the ïrst
declaration of that specialization. [ Example:
struct sometype {
sometype();
};
sometype::sometype() = delete; // ill-formed; not ïrst declaration
â end example ]"
$ cat bug.cpp
struct sometype {
sometype();
};
sometype::sometype() = delete;
$ g++ bug.cpp -std=c++11 -c
$ g++ --version
g++ (GCC) 4.7.0 20120314 (prerelease)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.