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

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 18:58:47 PDT 2016


EricWF created this revision.
EricWF added reviewers: mclow.lists, rsmith.
EricWF added subscribers: cfe-commits, rsmith.

This patch uses the __attribute__((enable_if)) hack suggested by @rsmith to diagnose invalid arguments when possible.

In order to diagnose an invalid argument `m` to `f(m)` we provide an additional overload of `f` that is only enabled when `m` is invalid. When that function is enabled it uses __attribute__((unavailable)) to produce a diagnostic message.

https://reviews.llvm.org/D22557

Files:
  include/atomic
  test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22557.64629.patch
Type: text/x-patch
Size: 10115 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160720/16ddbd1e/attachment-0001.bin>


More information about the cfe-commits mailing list