File tree 1 file changed +8
-2
lines changed
libcxx/test/std/atomics/atomics.lockfree
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 15
15
//
16
16
// static constexpr bool is_always_lock_free;
17
17
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
+
18
22
#include < atomic>
19
23
#include < cassert>
20
24
#include < concepts>
@@ -27,7 +31,8 @@ template <typename T>
27
31
void check_always_lock_free (std::atomic<T> const & a) {
28
32
using InfoT = LockFreeStatusInfo<T>;
29
33
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 );
31
36
32
37
// If we know the status of T for sure, validate the exact result of the function.
33
38
if constexpr (InfoT::status_known) {
@@ -45,7 +50,8 @@ void check_always_lock_free(std::atomic<T> const& a) {
45
50
46
51
// In all cases, also sanity-check it based on the implication always-lock-free => lock-free.
47
52
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 );
49
55
assert (is_lock_free);
50
56
}
51
57
ASSERT_NOEXCEPT (a.is_lock_free ());
You can’t perform that action at this time.
0 commit comments