You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://eel.is/c++draft/stmt.jump#2 says that objects with automatic storage duration are destroyed when leaving scope, however, if you end the lifetime of an object prematurely, it no longer exists, and since the wording in the standard only applies to objects during their lfetime, there would be no object to destroy, as the wording wouldn't apply an object who's lifetime is over.
Proposed Wording to fix:
[stmt.jump]/2
On exit from a scope (however accomplished), variables that refer to objects with automatic storage duration declared in that scope will be destroyed in the reverse order of their declaration. If a variable does not refer to an object and the type of the variable has a non-trivial destructor, the behavior is undefined.
The text was updated successfully, but these errors were encountered:
jensmaurer
changed the title
[stmt.jump]/2 Wording does not apply to objects who's lifetime has ended
[stmt.jump]/2 Wording does not apply to objects whose lifetime has ended
May 5, 2019
Issue
http://eel.is/c++draft/stmt.jump#2 says that objects with automatic storage duration are destroyed when leaving scope, however, if you end the lifetime of an object prematurely, it no longer exists, and since the wording in the standard only applies to objects during their lfetime, there would be no object to destroy, as the wording wouldn't apply an object who's lifetime is over.
Proposed Wording to fix:
[stmt.jump]/2
On exit from a scope (however accomplished), variables that refer to objects with automatic storage duration declared in that scope will be destroyed in the reverse order of their declaration. If a variable does not refer to an object and the type of the variable has a non-trivial destructor, the behavior is undefined.
The text was updated successfully, but these errors were encountered: