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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think we should just do this:

--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -77,7 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel;
   inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst;
 #else
-  typedef enum memory_order
+  enum memory_order : int
     {
       memory_order_relaxed,
       memory_order_consume,
@@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       memory_order_release,
       memory_order_acq_rel,
       memory_order_seq_cst
-    } memory_order;
+    };
 #endif

   /// @cond undocumented


That ensures a consistent underlying type for C++17 down and C++20 up (and gets
rid of the redundant typedef). This will mean the type isn't affected by the
-fshort-enums flag at all, which also happens to solve the static_assert
failure in comment 0.

This is an ABI change for the underlying type when using -fshort-enums, but
that flag is already explicitly ABI-changing and not the default, so I care
less about a change there.

Reply via email to