Clang currently issues diagnostics if the success memory order argument is invalid, but it doesn't check the failure ordering argument for cmpxchg atomic operations.
This patch adds diagnostics if the failure ordering is either memory_order_release or memory_order_acq_rel.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
ping. Clang correctly lowers the invalid memory orders, so do we want these diagnostics?
Comment Actions
Warnings look correct. Could they be made more useful by suggesting that acq_rel be acquire instead, and release be relaxed instead?
Comment Actions
Given http://wg21.link/p0418 I think this requires an update. I don't think the old behavior is worth supporting in older -std= versions, unless we're worried that it would make code less portable.