Open zygoloid opened 4 months ago
This seems wrong: "after the lifetime of an object has ended and not after the storage"
I think we want to leave "before" here, and not replace with "not after", because the user needs to prove (via happens-before) that the storage is still there.
CWG2863
It's stupid to have the out-of-lifetime-but-within-storage conditions repeated twice over. Fixed with wording "option 2".
This seems wrong: "after the lifetime of an object has ended and not after the storage"
You're right, I changed the wrong half here.
Reference (section label): [basic.life]
Issue description:
In [basic.life], we find utterances such as:
and
But that doesn't work -- it doesn't properly handle the case of an evaluation that is racing with the start of the lifetime of an object. That's not a data race, because data races are concerned with a race between a modification and an access, and this paragraph is covering all uses, not only accesses.
What we mean is: if an evaluation happens after the storage which an object will occupy has been allocated, but does not happen after the lifetime of the object has started, then [...] any pointer [...] may be used but only in limited ways.
Suggested resolution:
Replace the "before" and "after" with "not after" and "not before" as appropriate (rephrasing as necessary so the wording is still grammatical). Eg:
And likewise in /4, /7, /8.