55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
8- //
8+
99// UNSUPPORTED: c++03, c++11, c++14
10+ // XFAIL: !has-1024-bit-atomics
1011
1112// <atomic>
1213//
1516//
1617// static constexpr bool is_always_lock_free;
1718
19+ // Ignore diagnostic about vector types changing the ABI on some targets, since
20+ // that is irrelevant for this test.
21+ // ADDITIONAL_COMPILE_FLAGS: -Wno-psabi
22+
1823#include < atomic>
1924#include < cassert>
2025#include < concepts>
@@ -27,7 +32,8 @@ template <typename T>
2732void check_always_lock_free (std::atomic<T> const & a) {
2833 using InfoT = LockFreeStatusInfo<T>;
2934
30- constexpr std::same_as<const bool > decltype (auto ) is_always_lock_free = std::atomic<T>::is_always_lock_free;
35+ constexpr auto is_always_lock_free = std::atomic<T>::is_always_lock_free;
36+ ASSERT_SAME_TYPE (decltype (is_always_lock_free), bool const );
3137
3238 // If we know the status of T for sure, validate the exact result of the function.
3339 if constexpr (InfoT::status_known) {
@@ -45,7 +51,8 @@ void check_always_lock_free(std::atomic<T> const& a) {
4551
4652 // In all cases, also sanity-check it based on the implication always-lock-free => lock-free.
4753 if (is_always_lock_free) {
48- std::same_as<bool > decltype (auto ) is_lock_free = a.is_lock_free ();
54+ auto is_lock_free = a.is_lock_free ();
55+ ASSERT_SAME_TYPE (decltype (is_always_lock_free), bool const );
4956 assert (is_lock_free);
5057 }
5158 ASSERT_NOEXCEPT (a.is_lock_free ());
0 commit comments