This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
[Voted into WP at July, 2009 meeting.]
The requirements for the operand of thedelete operators aregiven in 7.6.2.9 [expr.delete] paragraph 2:
In either alternative, the value of the operand ofdelete maybe a null pointer value. If it is not a null pointer value, in thefirst alternative (delete object), the value of the operandofdelete shall be a pointer to a non-array object or apointer to a subobject (6.8.2 [intro.object]) representing abase class of such an object (11.7 [class.derived]). If not,the behavior is undefined. In the second alternative (deletearray), the value of the operand ofdelete shall be thepointer value which resulted from a previousarraynew-expression. If not, the behavior is undefined.
There are no restrictions on the type of a null pointer, only ona pointer that is not null. That seems wrong.
Proposed resolution (June, 2008):
Change 7.6.2.9 [expr.delete] paragraph 1 as follows:
...The operand shall have a pointerto object type, or aclass type having a single non-explicit conversion function(11.4.8.3 [class.conv.fct]) to a pointerto object type...
Proposed resolution (September, 2008):
Change 7.6.2.9 [expr.delete] paragraph 1 as follows:
...The operand shall have a pointerto object type, or aclass type having a single non-explicit conversion function(12.3.2) to a pointerto object type.[Footnote:This implies that an object cannot be deleted using a pointer oftypevoid* becausevoid is not an object type.—end footnote] ...
Delete the footnote at the end of 7.6.2.9 [expr.delete] paragraph 3:
...if the dynamic type of the object to be deleted differs fromits static type, the behavior is undefined.[Footnote:This implies that an object cannot be deleted using a pointer oftypevoid* because there are no objects of typevoid. —end footnote]