Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent wording in [new.delete.single] and [new.delete.array] #793

Closed
jwakely opened this issue Jul 5, 2016 · 4 comments
Closed

Inconsistent wording in [new.delete.single] and [new.delete.array] #793

jwakely opened this issue Jul 5, 2016 · 4 comments

Comments

@jwakely
Copy link
Member

jwakely commented Jul 5, 2016

[new.delete.single]/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).

[new.delete.array]/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).

Firstly, ptr should be using \tcode not \textit.

Secondly, why is one "its value shall be a value" and the other "its value shall be the value"?

Thirdly, why does the first state "possibly-replaced" but not the second?

@jwakely
Copy link
Member Author

jwakely commented Jul 5, 2016

And why does [new.delete.array] have the Requires about safely-derived pointers after the Required behavior?

@jwakely
Copy link
Member Author

jwakely commented Jul 6, 2016

(some of these problems were already fixed at e51a215 by the P0035R4 changes)

@jensmaurer
Copy link
Member

Current state:

[new.delete.single] p12
Requires: ptr shall be a null pointer or its value shall represent the address of a block of memory
allocated by an earlier call to a (possibly replaced) operator new(std::size_t) or operator new(std ::size_t, std::align_val_t) which has not been invalidated by an intervening call to operator delete.

[new.delete.array] p11
Requires: ptr shall be a null pointer or its value shall represent the address of a block of memory
allocated by an earlier call to a (possibly replaced) operator new[](std::size_t) or operator new[](std::size_t, std::align_val_t) which has not been invalidated by an intervening call to
operator delete[].

@jensmaurer
Copy link
Member

Looks like it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants