https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89624
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:72fe42c9a095ef9b4125bd65999cd1012dfb73b7 commit r14-11190-g72fe42c9a095ef9b4125bd65999cd1012dfb73b7 Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Apr 11 19:12:48 2024 +0100 libstdc++: Give std::memory_order a fixed underlying type [PR89624] Prior to C++20 this enum type doesn't have a fixed underlying type, which means it can be modified by -fshort-enums, which then means the HLE bits are outside the range of valid values for the type. As it has a fixed type of int in C++20 and later, do the same for earlier standards too. This is technically a change for C++17 down, because the implicit underlying type (without -fshort-enums) was unsigned before. I doubt it matters in practice. That incompatibility already exists between C++17 and C++20 and nobody has noticed or complained. Now at least the underlying type will be int for all -std modes. libstdc++-v3/ChangeLog: PR libstdc++/89624 * include/bits/atomic_base.h (memory_order): Use int as underlying type. * testsuite/29_atomics/atomic/89624.cc: New test. (cherry picked from commit 99dd1be14172445795f0012b935359e7014a2215)