[Bug c++/15898] New: Error with templated operator delete not detected
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Wed Jun 9 16:02:00 GMT 2004
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
More information about the Gcc-bugs
mailing list