+2020-05-08 Ulrich Drepper <drepper@redhat.com>
+
+ * include/bits/atomic_base.h (atomic_flag): Implement test member
+ function.
+ * include/std/version: Define __cpp_lib_atomic_flag_test.
+ * testsuite/29_atomics/atomic_flag/test/explicit.cc: New file.
+ * testsuite/29_atomics/atomic_flag/test/implicit.cc: New file.
+
2020-05-07 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/94971 (partial)
return __atomic_test_and_set (&_M_i, int(__m));
}
+#if __cplusplus > 201703L
+#define __cpp_lib_atomic_flag_test 201907L
+
+ _GLIBCXX_ALWAYS_INLINE bool
+ test(memory_order __m = memory_order_seq_cst) noexcept
+ {
+ __atomic_flag_data_type __v;
+ __atomic_load(&_M_i, &__v, int(__m));
+ return __v == __GCC_ATOMIC_TEST_AND_SET_TRUEVAL;
+ }
+
+ _GLIBCXX_ALWAYS_INLINE bool
+ test(memory_order __m = memory_order_seq_cst) volatile noexcept
+ {
+ __atomic_flag_data_type __v;
+ __atomic_load(&_M_i, &__v, int(__m));
+ return __v == __GCC_ATOMIC_TEST_AND_SET_TRUEVAL;
+ }
+#endif // C++20
+
_GLIBCXX_ALWAYS_INLINE void
clear(memory_order __m = memory_order_seq_cst) noexcept
{
#if __cplusplus > 201703L
// c++2a
+#define __cpp_lib_atomic_flag_test 201907L
#define __cpp_lib_atomic_float 201711L
#define __cpp_lib_atomic_ref 201806L
#define __cpp_lib_atomic_value_initialization 201911L