https://gcc.gnu.org/g:79d3f17b07884cc9486f5e6fb21beea97c153a55
commit r15-1980-g79d3f17b07884cc9486f5e6fb21beea97c153a55 Author: Damien Lebrun-Grandie <dal...@gmail.com> Date: Wed May 22 17:43:45 2024 -0400 libstdc++: the specialization atomic_ref<bool> should use the primary template Per [atomics.ref.int] `bool` is excluded from the list of integral types for which there is a specialization of the `atomic_ref` class template and [Note 1] clearly states that `atomic_ref<bool>` "uses the primary template" instead. libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (__atomic_ref): Do not use integral specialization for bool. Signed-off-by: Damien Lebrun-Grandie <dal...@gmail.com> Diff: --- libstdc++-v3/include/bits/atomic_base.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 20901b7fc06f..1c2367b39b66 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -1478,7 +1478,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #undef _GLIBCXX20_INIT template<typename _Tp, - bool = is_integral_v<_Tp>, bool = is_floating_point_v<_Tp>> + bool = is_integral_v<_Tp> && !is_same_v<_Tp, bool>, + bool = is_floating_point_v<_Tp>> struct __atomic_ref; // base class for non-integral, non-floating-point, non-pointer types