@@ -739,6 +739,7 @@ ftms = {
values = {
v = 201907;
cxxmin = 20;
+ extra_cond = "(__GCC_ATOMIC_INT_LOCK_FREE | __GCC_ATOMIC_LONG_LOCK_FREE | __GCC_ATOMIC_CHAR_LOCK_FREE) & 2";
};
};
@@ -819,7 +819,7 @@
#undef __glibcxx_want_atomic_float
#if !defined(__cpp_lib_atomic_lock_free_type_aliases)
-# if (__cplusplus >= 202002L)
+# if (__cplusplus >= 202002L) && ((__GCC_ATOMIC_INT_LOCK_FREE | __GCC_ATOMIC_LONG_LOCK_FREE | __GCC_ATOMIC_CHAR_LOCK_FREE) & 2)
# define __glibcxx_atomic_lock_free_type_aliases 201907L
# if defined(__glibcxx_want_all) || defined(__glibcxx_want_atomic_lock_free_type_aliases)
# define __cpp_lib_atomic_lock_free_type_aliases 201907L
@@ -1774,13 +1774,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= atomic<make_signed_t<__detail::__platform_wait_t>>;
using atomic_unsigned_lock_free
= atomic<make_unsigned_t<__detail::__platform_wait_t>>;
-# elif ATOMIC_INT_LOCK_FREE || !(ATOMIC_LONG_LOCK_FREE || ATOMIC_CHAR_LOCK_FREE)
+# elif ATOMIC_INT_LOCK_FREE == 2
using atomic_signed_lock_free = atomic<signed int>;
using atomic_unsigned_lock_free = atomic<unsigned int>;
-# elif ATOMIC_LONG_LOCK_FREE
+# elif ATOMIC_LONG_LOCK_FREE == 2
using atomic_signed_lock_free = atomic<signed long>;
using atomic_unsigned_lock_free = atomic<unsigned long>;
-# elif ATOMIC_CHAR_LOCK_FREE
+# elif ATOMIC_CHAR_LOCK_FREE == 2
using atomic_signed_lock_free = atomic<signed char>;
using atomic_unsigned_lock_free = atomic<unsigned char>;
# else
@@ -651,7 +651,7 @@ namespace std::chrono
template<typename _Tp> requires _Tp::is_always_lock_free
struct RulesCounter<_Tp>
{
- atomic_signed_lock_free counter{0};
+ _Tp counter{0};
void
increment()
@@ -703,7 +703,12 @@ namespace std::chrono
};
#endif // __GTHREADS && __cpp_lib_atomic_wait
+#if __cpp_lib_atomic_lock_free_type_aliases
RulesCounter<atomic_signed_lock_free> rules_counter;
+#else
+ RulesCounter<void> rules_counter;
+#endif
+
#else // TZDB_DISABLED
_Impl(weak_ptr<tzdb_list::_Node>) { }
struct {
@@ -1,5 +1,6 @@
// { dg-do compile { target c++20 } }
// { dg-add-options no_pch }
+// { dg-require-atomic-cmpxchg-word "PR libstdc++/114103" }
#include <atomic>