This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


523. Can a one-past-the-end pointer be invalidated by deleting an adjacent object?

Section:  []     Status: open     Submitter: comp.std.c++     Date: 8 July 2005

When an object is deleted, [] says that the deallocation “[renders] invalid all pointers referring to any part of the deallocated storage.” According to 6.8.4 [basic.compound] paragraph 3, a pointer whose address is one past the end of an array is considered to point to an unrelated object that happens to reside at that address. Does this need to be clarified to specify that the one-past-the-end pointer of an array is not invalidated by deleting the following object? (See also [expr.delete] paragraph 4, which also mentions that the system deallocation function renders a pointer invalid.)