This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31988] New: new operator should not permit default first parameter
- From: "andrew dot stubbs at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 May 2007 14:41:21 -0000
- Subject: [Bug c++/31988] New: new operator should not permit default first parameter
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following C++ program should not compile:
#include <new>
class C
{
public:
void * operator new (size_t = 32); // invalid
};
The C++ standard, clause 3.7.3.1, paragraph 1, says that the first parameter to
new should not have a default argument. GCC gives no error and no warning.
--
Summary: new operator should not permit default first parameter
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrew dot stubbs at st dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31988