This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15898] New: Error with templated operator delete not detected
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2004 16:02:46 -0000
- Subject: [Bug c++/15898] New: Error with templated operator delete not detected
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
3.7.3.2/2 specifically says that an operator delete that is a template
shall have at least two function arguments. That makes sense, since the
first one is fixed to be void*, so in order to deduce template
arguments, we need at least a second function argument. However, as
originally noted in PR 15890, this does not trigger an error:
---------------
template < typename T >
void operator delete ( void* raw ) {}
int main() {
char* a = new char;
delete a;
}
---------------
All gcc versions simply accept this.
W.
--
Summary: Error with templated operator delete not detected
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org,jkherciueh at gmx dot
net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15898