-
Notifications
You must be signed in to change notification settings - Fork 7
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
CWG2957 [intro.memory] References should be memory locations #637
Comments
Looks like this is very much related to #634, which highlights that we also need to refine the notion of "access" to cover the situation. |
Oh yeah, it seems pretty much identical to #634 then. |
CWG decided yesterday that this will be split off into a separate issue. |
[basic.life]/4: The properties ascribed to objects and references throughout this document apply for a given object or reference only during its lifetime. This needs to be clarified (maybe even editorially) that «during lifetime» == «after lifetime starts»+«before lifetime ends», where «before» and «after» in the subclause has known meaning http://eel.is/c++draft/basic.life#12 So, |
This part is addressed by CWG2863. I'd use |
Reference (section label): [intro.memory]
Issue description
Assuming that
thread_w()
,thread_p()
, andthread_r()
are executed concurrently,thread_r
has well-defined behavior despite binding a reference to a glvalue which changes the identity that it determines concurrently.Paradoxically (and unlike
thread_p()
, in which a data race occurs), this is well-defined because a memory location isTherefore, storage occupied by references (which is possible; see [dcl.ref] p4) is immune from data races, but it should not be.
Suggested resolution
This resolution is relative to CWG1953, 2024-10-25.
Update [intro.memory], paragraph 3 as follows:
The text was updated successfully, but these errors were encountered: