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
[intro.execution] A full-expression is: an invocation of a destructor generated at the end of the lifetime #4052
Comments
What exactly is your concern here? That "at the end of the lifetime" should be "near the end of the lifetime" or similar? Something else? |
When exit from block? When the subobjects are destroyed after destructor's body finishes execution? I assume both of this. Does this include the case when in partially initialized aggregate some constructor throws and already constructed members are destroyed? Probably not. Maybe it is specified somewhere and I couldn't find it. |
This is a definition of "full-expression". Invocations of the destructors mentioned here occur on exit from the block [stmt.jump], on exit from a thread, or on termination of a program. [basic.start.term] |
Ok, but those paragraphs also don't say that the invocations of the destructors there are very those invocations mentioned in the definition of full-expression. |
How and where else would destructor invocations be generated at the end of the lifetime of an object? The full-expression definition means all such implicit destructor invocations are in scope. |
And I don't understand why are you saying "destructor invocations be generated at the end of the lifetime of an object". We end the lifetime of an object by generating destructor invocation for it, not the other way around. Maybe you mean "when its storage duration would end"? |
Storage duration and destruction are different.Those mentioned locations tell you when an object is destroyed, not when the storage duration ends. The full-expression section just says "those particular invocations are full-expressions", nothing else. Could you please suggest a specific change that you want to see applied? |
If to speak purely about wording, I'd say
I don't understand why it is clear that this bullet means only invocations of destructors for variables on block, thread or program exit, but doesn't mean invocations of destructor for constructed aggregate elements when constructor of one of them throws during parent aggregate initialization. These destructor invocations are not generated? Or because if we consider the last case to be a full-expression, this would be incompatible with objects destruction order? (In reverse to their construction order). |
This is unclear. The lifetime ends when a destructor's call start, not the other way around, but this is just a wording bug. It is not specified when such invocations are generated.
The text was updated successfully, but these errors were encountered: