File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
libcxx/test/std/atomics/atomics.lockfree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1515//
1616// static constexpr bool is_always_lock_free;
1717
18+ // Ignore diagnostic about vector types changing the ABI on some targets, since
19+ // that is irrelevant for this test.
20+ // ADDITIONAL_COMPILE_FLAGS: -Wno-psabi
21+
1822#include < atomic>
1923#include < cassert>
2024#include < concepts>
@@ -27,7 +31,8 @@ template <typename T>
2731void check_always_lock_free (std::atomic<T> const & a) {
2832 using InfoT = LockFreeStatusInfo<T>;
2933
30- constexpr std::same_as<const bool > decltype (auto ) is_always_lock_free = std::atomic<T>::is_always_lock_free;
34+ constexpr auto is_always_lock_free = std::atomic<T>::is_always_lock_free;
35+ ASSERT_SAME_TYPE (decltype (is_always_lock_free), bool const );
3136
3237 // If we know the status of T for sure, validate the exact result of the function.
3338 if constexpr (InfoT::status_known) {
@@ -45,7 +50,8 @@ void check_always_lock_free(std::atomic<T> const& a) {
4550
4651 // In all cases, also sanity-check it based on the implication always-lock-free => lock-free.
4752 if (is_always_lock_free) {
48- std::same_as<bool > decltype (auto ) is_lock_free = a.is_lock_free ();
53+ auto is_lock_free = a.is_lock_free ();
54+ ASSERT_SAME_TYPE (decltype (is_always_lock_free), bool const );
4955 assert (is_lock_free);
5056 }
5157 ASSERT_NOEXCEPT (a.is_lock_free ());
You can’t perform that action at this time.
0 commit comments