[libcxx-commits] [libcxx] r355521 - [libc++] Do not specify the underlying type of memory_order

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 6 09:07:24 PST 2019


Author: ldionne
Date: Wed Mar  6 09:07:24 2019
New Revision: 355521

URL: http://llvm.org/viewvc/llvm-project?rev=355521&view=rev
Log:
[libc++] Do not specify the underlying type of memory_order

Summary:
This breaks ABI for folks using -fshort-enums, and does not really buy
us anything.

http://llvm.org/PR40977

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, zoecarver

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

Modified:
    libcxx/trunk/include/atomic

Modified: libcxx/trunk/include/atomic
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?rev=355521&r1=355520&r2=355521&view=diff
==============================================================================
--- libcxx/trunk/include/atomic (original)
+++ libcxx/trunk/include/atomic Wed Mar  6 09:07:24 2019
@@ -586,7 +586,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 #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_relea
 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 @@ typedef enum memory_order {
   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) || \




More information about the libcxx-commits mailing list