[compiler-rt] test: get rid of redundant TODO tag in fuzz tests (PR #137395)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 14:03:20 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: kevkevin (kevkevinpal)

<details>
<summary>Changes</summary>

'list.size()' is determined at runtime, so using static_assert on it as suggested by the TODO comment is not feasible and produces the following error when done:

error: static assertion expression is not an integral constant expression

initially referenced in https://github.com/bitcoin/bitcoin/pull/32024

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


1 Files Affected:

- (modified) compiler-rt/include/fuzzer/FuzzedDataProvider.h (-1) 


``````````diff
diff --git a/compiler-rt/include/fuzzer/FuzzedDataProvider.h b/compiler-rt/include/fuzzer/FuzzedDataProvider.h
index 11f2fbdb8c854..33ffa8bc00bfa 100644
--- a/compiler-rt/include/fuzzer/FuzzedDataProvider.h
+++ b/compiler-rt/include/fuzzer/FuzzedDataProvider.h
@@ -314,7 +314,6 @@ T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
 
 template <typename T>
 T FuzzedDataProvider::PickValueInArray(std::initializer_list<const T> list) {
-  // TODO(Dor1s): switch to static_assert once C++14 is allowed.
   if (!list.size())
     abort();
 

``````````

</details>


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


More information about the llvm-commits mailing list