55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
8- //
8+
99// UNSUPPORTED: c++03, c++11, c++14
10+ // XFAIL: LIBCXX-PICOLIBC-FIXME
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 < cstddef>
@@ -26,7 +31,8 @@ template <typename T>
2631void check_always_lock_free (std::atomic<T> const & a) {
2732 using InfoT = LockFreeStatusInfo<T>;
2833
29- 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 );
3036
3137 // If we know the status of T for sure, validate the exact result of the function.
3238 if constexpr (InfoT::status_known) {
@@ -44,7 +50,8 @@ void check_always_lock_free(std::atomic<T> const& a) {
4450
4551 // In all cases, also sanity-check it based on the implication always-lock-free => lock-free.
4652 if (is_always_lock_free) {
47- 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 );
4855 assert (is_lock_free);
4956 }
5057 ASSERT_NOEXCEPT (a.is_lock_free ());
0 commit comments