Skip to content

Commit 037efef

Browse files
ldionnetru
authored andcommitted
[libc++] Fix name of is_always_lock_free test which was never being run
1 parent c26a522 commit 037efef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.cpp renamed to libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
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>
2731
void 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());

0 commit comments

Comments
 (0)