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

[basic.life]p5 is missing a case where the program can explicitly end the lifetime of an object after P0593R6 #3743

Closed
zygoloid opened this issue Feb 19, 2020 · 0 comments
Assignees
Milestone

Comments

@zygoloid
Copy link
Member

[basic.life]p6:

A program may end the lifetime of any object by reusing the storage which the object occupies or by explicitly calling the destructor for an object of a class type. For an object of a class type, the program is not required to call the destructor explicitly before the storage which the object occupies is reused or released; however, if there is no explicit call to the destructor or if a delete-expression (7.6.2.8) is not used to release the storage, the destructor is not implicitly called and any program that depends on the side effects produced by the destructor has undefined behavior.

... needs updating to match the rule in P0593R6. Suggestion:

A program may end the lifetime of any object by reusing the storage which the object occupies or by explicitly calling the destructor for an object of a class type or pseudo-destructor ([expr.prim.id.dtor]). [...]

@jensmaurer jensmaurer added this to the C++20 milestone Feb 19, 2020
@zygoloid zygoloid self-assigned this Feb 20, 2020
zygoloid added a commit that referenced this issue Feb 20, 2020
pseudo-destructors end the lifetime of an object.

Fixes #3743.
zygoloid added a commit that referenced this issue Feb 25, 2020
pseudo-destructors end the lifetime of an object.

Fixes #3743.
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