Skip to content
Commit 586b16e1 authored by Eric Fiselier's avatar Eric Fiselier
Browse files

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

Summary:
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.

Reviewers: mclow.lists, rsmith, jfb, EricWF

Subscribers: bcraig, jfb, rsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D22557

llvm-svn: 276506
parent a7d9ec87
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment