[compiler-rt] [sanitizer-common] sanitizer_array_ref_test should not require C++17 (PR #161252)

Andrew Haberlandt via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 11:08:09 PDT 2025


https://github.com/ndrewh created https://github.com/llvm/llvm-project/pull/161252

Currently, sanitizer_array_ref_test requires -std=c++17 or newer, due to is_trivially_copyable_v. This is the only test that requires c++17, and thus we use the c++14-available std::is_trivially_copyable instead for now, rather than adding the c++17 cflag.

>From 71c4cf60a2600521397eea25c278e7aca65bfbab Mon Sep 17 00:00:00 2001
From: Andrew Haberlandt <ahaberlandt at apple.com>
Date: Mon, 29 Sep 2025 11:04:16 -0700
Subject: [PATCH] [sanitizer-common] sanitizer_array_ref_test should not
 require C++17

Currently, sanitizer_array_ref_test requires -std=c++17 or newer,
due to is_trivially_copyable_v. This is the only test that requires
c++17, and thus we use the c++14-available std::is_trivially_copyable
instead for now, rather than adding the c++17 cflag.
---
 .../lib/sanitizer_common/tests/sanitizer_array_ref_test.cpp     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_array_ref_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_array_ref_test.cpp
index 12a83df455d39..acb9f950c9914 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_array_ref_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_array_ref_test.cpp
@@ -125,7 +125,7 @@ TEST(ArrayRefTest, ArrayRef) {
   EXPECT_TRUE(ar2.equals(ar2_ref));
 }
 
-static_assert(std::is_trivially_copyable_v<ArrayRef<int>>,
+static_assert(std::is_trivially_copyable<ArrayRef<int>>::value,
               "trivially copyable");
 
 }  // namespace



More information about the llvm-commits mailing list