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

JF Bastien via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 22 17:27:02 PDT 2016


On Jul 22, 2016 4:45 PM, "Eric Fiselier" <eric at efcs.ca> wrote:
>
> EricWF added inline comments.
>
> ================
> Comment at: test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp:87
> @@ +86,3 @@
> +        x.compare_exchange_weak(val1, val2, std::memory_order_release);
> +    }
> +    {
> ----------------
> jfb wrote:
> > That's not quite true: the failure ordering is auto-deduced from the
success one, but it's not necessarily the same! The spec says all success
is valid, so the auto-mapping has to ensure that all failures are also
valid. That's what I'm trying to have you test: that the auto-mapping is
always valid as well.
> Right, but the auto-mapping is done once we have entered the
`compare_exchange_weak` function, These diagnostics are triggered within
the function signature. So even if we got the auto mapping wrong this test
would not be able to diagnose it.
>
> I agree we should be testing the auto-mapping, but I don't think this
test is the right place to do it.

Ah ok, that's good with me then.

>
> https://reviews.llvm.org/D22557
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160722/4df1ca15/attachment.html>


More information about the cfe-commits mailing list