Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++17 status.

2425.operator delete(void*, size_t) doesn't invalidate pointers sufficiently

Section: 17.6.3[new.delete]Status:C++17Submitter: Richard SmithOpened: 2014-08-29Last modified: 2017-07-30

Priority:0

View all otherissues in [new.delete].

View all issues withC++17 status.

Discussion:

17.6.3.2[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) oroperator new(std::size_t,const std::nothrow_t&) which has not been invalidated by an intervening call tooperator delete(void*).

This should say:

[…] by an intervening call tooperator delete(void*)oroperator delete(void*, std::size_t).

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

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

Proposed resolution:

  1. Change 17.6.3.2[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) oroperator new(std::size_t,const std::nothrow_t&) which has not been invalidated by an intervening call tooperator delete(void*)oroperator delete(void*, std::size_t).

  2. Change 17.6.3.3[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 tooperator new[](std::size_t) oroperator new[](std::size_t,const std::nothrow_t&) which has not been invalidated by an intervening call tooperator delete[](void*)oroperator delete[](void*, std::size_t).


[8]ページ先頭

©2009-2026 Movatter.jp