Skip to content

Commit 4ee747f

Browse files
authored
[libc++][test] Don't use __libcpp_is_constant_evaluated in tests (#72226)
1 parent 65eaec8 commit 4ee747f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libcxx/test/support/asan_testing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern "C" int __sanitizer_verify_contiguous_container
1919
template <typename T, typename Alloc>
2020
TEST_CONSTEXPR bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &c )
2121
{
22-
if (std::__libcpp_is_constant_evaluated())
22+
if (TEST_IS_CONSTANT_EVALUATED)
2323
return true;
2424
if (std::is_same<Alloc, std::allocator<T> >::value && c.data() != NULL)
2525
return __sanitizer_verify_contiguous_container(

libcxx/test/support/min_allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,14 @@ class safe_allocator {
464464

465465
TEST_CONSTEXPR_CXX20 T* allocate(std::size_t n) {
466466
T* memory = std::allocator<T>().allocate(n);
467-
if (!std::__libcpp_is_constant_evaluated())
467+
if (!TEST_IS_CONSTANT_EVALUATED)
468468
std::memset(memory, 0, sizeof(T) * n);
469469

470470
return memory;
471471
}
472472

473473
TEST_CONSTEXPR_CXX20 void deallocate(T* p, std::size_t n) {
474-
if (!std::__libcpp_is_constant_evaluated())
474+
if (!TEST_IS_CONSTANT_EVALUATED)
475475
DoNotOptimize(std::memset(p, 0, sizeof(T) * n));
476476
std::allocator<T>().deallocate(p, n);
477477
}

0 commit comments

Comments
 (0)