https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89624

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-03-07
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #0)
> This will be an ABI break for -fshort-enums though, but that's already
> happened for PR 88996 because the new definition is a scoped enum, which
> always has a fixed underlying type.

To be clear, the recent break can be easily fixed:

--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -53,7 +53,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION

   /// Enumeration for memory_order
 #if __cplusplus > 201703L
-  enum class memory_order : int
+  // This determines the underlying type of memory_order,
+  // because its size can change when -fshort-enums is used.
+  enum __unscoped_memory_order { __unscoped_memory_order_max = 5 };
+
+  enum class memory_order : __underlying_type(__unscoped_memory_order)
     {
       relaxed,
       consume,

But that wouldn't solve the problem for the HLE bits.

Reply via email to