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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Andrew Haberlandt (ndrewh)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/161252.diff


1 Files Affected:

- (modified) compiler-rt/lib/sanitizer_common/tests/sanitizer_array_ref_test.cpp (+1-1) 


``````````diff
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

``````````

</details>


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


More information about the llvm-commits mailing list