[PATCH] D22557: [libcxx] Diagnose invalid memory order arguments in <atomic>. Fixes PR21179.

JF Bastien via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 10:38:38 PDT 2016


jfb added a comment.

Two comments, then lgtm.


================
Comment at: include/atomic:581
@@ +580,3 @@
+                               || __f == memory_order_acq_rel, "")))          \
+    __attribute__ ((__unavailable__("memory order argument to atomic operation is invalid")))
+#endif
----------------
OK that's totally fine with me. Could you put this in a comment? Something like "not checking the 'stronger' requirement, see wg21.link/p0418" (it'll be published in the pre-Issaquah meeting, URL will work then).

================
Comment at: test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp:86
@@ +85,3 @@
+        // does not generate any diagnostics.
+        x.compare_exchange_weak(val1, val2, std::memory_order_release);
+    }
----------------
Could you do the other 5 (same below).


https://reviews.llvm.org/D22557





More information about the cfe-commits mailing list