[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 13:17:11 PST 2023


================
@@ -8728,7 +8728,13 @@ def err_atomic_op_needs_atomic_int : Error<
   "%select{|atomic }0integer (%1 invalid)">;
 def warn_atomic_op_has_invalid_memory_order : Warning<
   "memory order argument to atomic operation is invalid">,
-  InGroup<DiagGroup<"atomic-memory-ordering">>;
+  InGroup<AtomicMemoryOrdering>;
+def warn_atomic_op_has_invalid_failure_memory_order : Warning<
----------------
jyknight wrote:

Merge with former diagnostic by adding:
`%select{|success |failure }` to the beginning of the message, and adjusting callers to stream 0, 1, or 2 as the first param, for non-cmpxchg, cmpxchg-success, cmpxchg-failure.

https://github.com/llvm/llvm-project/pull/74959


More information about the cfe-commits mailing list