Title
operator delete(void*, size_t) doesn't invalidate pointers sufficiently
Status
c++17
Section
[new.delete]
Submitter
Richard Smith

Created on 2014-08-29.00:00:00 last changed 90 months ago

Messages

Date: 2014-11-08.16:43:57

Proposed resolution:

  1. Change [new.delete.single]p12 as indicated:

    -12- Requires: ptr shall be a null pointer or its value shall be a value returned by an earlier call to the (possibly replaced) operator new(std::size_t) or operator new(std::size_t,const std::nothrow_t&) which has not been invalidated by an intervening call to operator delete(void*) or operator delete(void*, std::size_t).

  2. Change [new.delete.array]p11 as indicated:

    -11- Requires: ptr shall be a null pointer or its value shall be the value returned by an earlier call to operator new[](std::size_t) or operator new[](std::size_t,const std::nothrow_t&) which has not been invalidated by an intervening call to operator delete[](void*) or operator delete[](void*, std::size_t).

Date: 2014-11-08.16:43:57

[ Urbana 2014-11-07: Move to Ready ]

Date: 2014-08-29.00:00:00

[new.delete.single]/12 says:

Requires: ptr shall be a null pointer or its value shall be a value returned by an earlier call to the (possibly replaced) operator new(std::size_t) or operator new(std::size_t,const std::nothrow_t&) which has not been invalidated by an intervening call to operator delete(void*).

This should say:

[…] by an intervening call to operator delete(void*) or operator delete(void*, std::size_t).

Likewise at the end of [new.delete.array]/11, operator delete[](void*, std::size_t).

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-05-22 18:31:21adminsetstatus: ready -> wp
2014-11-08 16:43:57adminsetmessages: + msg7177
2014-11-08 16:43:57adminsetstatus: new -> ready
2014-10-05 21:18:53adminsetmessages: + msg7112
2014-08-29 00:00:00admincreate