It is undefined behavior and clang now enforces this.
https://github.com/WebKit/WebKit/pull/22049
(In reply to Seija K. from comment #0) > It is undefined behavior and clang now enforces this. Can you please point us to the C++ spec where it says that using release or acq_rel for the failure memory order is undefined behavior? Thanks.
<rdar://problem/120047049>
(In reply to Mark Lam from comment #2) > Can you please point us to the C++ spec where it says that using release or > acq_rel for the failure memory order is undefined behavior? Thanks. From https://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange: ``` If failure is stronger than success or(until C++17) is one of std::memory_order_release and std::memory_order_acq_rel, the behavior is undefined. ``` Also, from that link, there's a table that says for `compare_exchange_strong`'s "load operation" in the failure mode, to use: ``` * std::memory_order_acquire if order is std::memory_order_acq_rel * std::memory_order_relaxed if order is std::memory_order_release * otherwise order ```
Committed 272461@main (d2ba4a07e209): <https://commits.webkit.org/272461@main> Reviewed commits have been landed. Closing PR #22049 and removing active labels.