You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void store(T desired, memory_order order = memory_order::seq_cst) volatile noexcept;
void store(T desired, memory_order order = memory_order::seq_cst) noexcept;
Preconditions: The order argument is neither memory_order::consume, memory_order::acquire, nor memory_order::acq_rel.
The LWG side asked me to open an editorial post about this issue, even though I have already tried to report an issue on CWG, and the CWG side(cplusplus/CWG#398) has confirmed that this issue should be reported as an LWG issue. The original issue is:
#include<atomic>intmain(){
std::atomic<int> v{0};
auto invented_ordering = static_cast<std::memory_order>(1024);
v.store(1,invented_ordering);
}
[enum.dcl.enum] p8 says:
It is possible to define an enumeration that has values not defined by any of its enumerators.
The invented_ordering does not violate the preconditions of the store, however, this is obviously problematic.
The text was updated successfully, but these errors were encountered:
Before the project editors close this as non-editorially I would like to remind that the corresponding Effects: are defined as follows:
"[...] Memory is affected according to the value of order."
But the standard does not define the meaning of std::memory_order(1024), so to me one can argue that it is possible to solve this editorially by re-expressing the Preconditions: in a positive form listing only the valid values, since the user cannot rely on a concrete effect anyway.
The LWG side asked me to open an editorial post about this issue, even though I have already tried to report an issue on CWG, and the CWG side(cplusplus/CWG#398) has confirmed that this issue should be reported as an LWG issue. The original issue is:
[enum.dcl.enum] p8 says:
The
invented_ordering
does not violate the preconditions of the store, however, this is obviously problematic.The text was updated successfully, but these errors were encountered: