Open
Description
Full name of submitter (unless configured in github; will be published with the issue): Jiang An
Reference (section label): [basic.life]
Link to reflector thread (if any):
Issue description:
Currently, [basic.life] p11 says non-trivial destructor, which might be misleading, because such UB can happen even when the destructor is trivial. It seems that such UB (calling non-static member function for an out-of-lifetime object) is already specified in p7 and/or p8, and thus p11 seems completely redundant.
cplusplus/draft#6389 attempted to resolve this but it was rejected.
Suggested resolution:
Modify [basic.life] p11 as indicated (turn it into a note, and remove mentioning of triviality):
- [Note ?: If a program ends the lifetime of an object of type
T
with static ([basic.stc.static]), thread ([basic.stc.thread]), or automatic ([basic.stc.auto]) storage duration and if T has a non-trivial destructorfor which destructor will be called implicitly, [...] [Example 4: [...] — end example] — end note]
This might be added to CWG3022.
Metadata
Metadata
Assignees
Labels
No labels