Section: 16.4.6.10 [res.on.data.races] Status: New Submitter: Jiang An Opened: 2024-07-30 Last modified: 2024-08-03
Priority: Not Prioritized
View other active issues in [res.on.data.races].
View all other issues in [res.on.data.races].
View all issues with New status.
Discussion:
From PR cplusplus/draft#6748 which was closed as non-editorial.
Currently, 16.4.6.10 [res.on.data.races] is talking about arguments and "includingthis
",
but this
is not a function argument. Moreover, it seems more appropriate to say that a function
accesses some object via a parameter.
It might need to be considered whether we should use the more general term "range" instead of "container",
which will cover std::span
, etc.
Proposed resolution:
This wording is relative to N4986.
Modify 16.4.6.10 [res.on.data.races] as indicated:
-2- A C++ standard library function shall not directly or indirectly access objects (6.9.2 [intro.multithread]) accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's
-3- A C++ standard library function shall not directly or indirectly modify objects (6.9.2 [intro.multithread]) accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's non-constargumentsparameters, includingthe object parameter (if any).this
argumentsparameters, includingthe object parameter (if any). […] -5- A C++ standard library function shall not access objects indirectly accessible via itsthis
argumentsparameters or via elements of its containerargumentsparameters except by invoking functions required by its specification on those container elements.