[PATCH] D22557: [libcxx] Diagnose invalid memory order arguments in <atomic>. Fixes PR21179.
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 20 19:20:53 PDT 2016
EricWF marked 2 inline comments as done.
================
Comment at: include/atomic:581
@@ +580,3 @@
+ || __f == memory_order_acq_rel, ""))) \
+ __attribute__ ((__unavailable__("memory order argument to atomic operation is invalid")))
+#endif
----------------
jfb wrote:
> This isn't checking for the following requirement from the standard:
>
> > The failure argument shall be no stronger than the success argument.
>
> I think that's OK because I intend to remove that requirement from C++ :)
>
> Should we nonetheless enforce the requirement until the standard drops it? If so, "stronger" isn't well defined by the standard, details here: https://github.com/jfbastien/papers/blob/master/source/D0418r1.bs
Because "stronger" lacks a solid definition I choose not to implement checks for that requirement. I believe Clang does as well.
> I think that's OK because I intend to remove that requirement from C++ :)
Yet another reason to not implement it.
https://reviews.llvm.org/D22557
More information about the cfe-commits
mailing list