This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29164] Overloaded operator delete[] doesn't get called
- From: "fang at csl dot cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2007 03:47:59 -0000
- Subject: [Bug c++/29164] Overloaded operator delete[] doesn't get called
- References: <bug-29164-13282@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from fang at csl dot cornell dot edu 2007-03-11 03:47 -------
In fact, I'm having trouble reproducing the problem when operator delete []
returns anything BUT NULL. It's as if, the actual call to operator delete []
is guarded by a NULL check. Now, if I'm RTHS (reading the holy standard)
correctly,
in [basic.stc.dynamic.deallocation] 3.7.4.2/3:
"The value of the first argument supplied to a deallocation functions may be a
null pointer value; if so, and if the deallocation function is one supplied in
the standard library, the call has no effect."
This seems to apply specifically to the standard library, but not necessarily
non-standard implementations of the operator. Does that mean that the call to
operator delete [] can be elided legally if the argument is NULL, or that the
implementation of operator delete [] (NULL) is required to have no effect?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29164