[libcxx-commits] [PATCH] D59029: [libc++] Do not specify the underlying type of memory_order
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 6 08:53:04 PST 2019
ldionne created this revision.
ldionne added reviewers: mclow.lists, EricWF.
Herald added subscribers: libcxx-commits, dexonsmith, jkorous, christof.
This breaks ABI for folks using -fshort-enums, and does not really buy
us anything.
http://llvm.org/PR40977
Repository:
rCXX libc++
https://reviews.llvm.org/D59029
Files:
libcxx/include/atomic
Index: libcxx/include/atomic
===================================================================
--- libcxx/include/atomic
+++ libcxx/include/atomic
@@ -586,7 +586,7 @@
#if _LIBCPP_STD_VER > 17
-enum class memory_order: unsigned {
+enum class memory_order {
relaxed, consume, acquire, release, acq_rel, seq_cst
};
@@ -597,9 +597,6 @@
inline constexpr auto memory_order_acq_rel = memory_order::acq_rel;
inline constexpr auto memory_order_seq_cst = memory_order::seq_cst;
-static_assert((is_same<underlying_type<memory_order>::type,
- unsigned>::value), "Underlying type differs from unsigned unexpectedly");
-
#else
typedef enum memory_order {
@@ -607,12 +604,9 @@
memory_order_release, memory_order_acq_rel, memory_order_seq_cst
} memory_order;
-static_assert((is_same<underlying_type<memory_order>::type,
- unsigned>::value), "Underlying type differs from unsigned unexpectedly");
-
#endif // _LIBCPP_STD_VER > 17
-typedef underlying_type<memory_order>::type __memory_order_underlying_t; // unsigned
+typedef underlying_type<memory_order>::type __memory_order_underlying_t;
#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59029.189519.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190306/ac0808c9/attachment-0001.bin>
More information about the libcxx-commits
mailing list