This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
Section: 32.5.8.2 [atomics.types.operations] Status: New Submitter: jim x Opened: 2026-11-30 Last modified: 2026-12-04
Priority: Not Prioritized
View other active issues in [atomics.types.operations].
View all other issues in [atomics.types.operations].
View all issues with New status.
Discussion:
Consider the following example:
#include <atomic>
int main()
{
std::atomic<int> value = 1;
auto r = value.load() + value.load();
}
In this example, it is intuitively expected that the two atomic load operations are indeterminately sequenced with respect to each other, rather than being unsequenced.
The intended rule to establish this ordering is 6.10.1 [intro.execution] p12:For each function invocation F, each evaluation that does not occur within F […] is either sequenced before all evaluations that occur within F or sequenced after all evaluations that occur within F; […]
However, according to 6.10.1 [intro.execution] p10:
Except where noted, evaluations of operands of individual operators and of subexpressions of individual expressions are unsequenced.
The function call expressions themselves (the two instances of value.load()) are subexpressions of
the operands of the + operator. A function call expression does not occur within the function
invocation it initiates.
Proposed resolution: