[PATCH] D59029: [libc++] Do not specify the underlying type of memory_order
Marshall Clow via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 09:38:45 PST 2019
mclow.lists added a comment.
In D59029#1420019 <https://reviews.llvm.org/D59029#1420019>, @ldionne wrote:
> Actually, the only `static_assert` I can conceive here would be this:
[snip]
> TBH, I don't think there's a lot of value in this. However, if we care that much about this, then I'd probably revert my previous position of not back-porting the enum class behavior to pre-C++20. IOW, instead of adding this complexity, I'd just make the definition the same in C++17 and C++20, and we'd be non-conforming in C++17.
I think we can put the `static_assert` in a test, instead. Something like:
typedef enum Fooby { six dummy values };
static_assert(sizeof(std::memory_order) == sizeof(Fooby), "" );
and that should pass on both C++17 and 20 with and without `fshort-enums`
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59029/new/
https://reviews.llvm.org/D59029
More information about the llvm-commits
mailing list