[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:02:27 PDT 2025


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

'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

>From df1c923d270257ace8557a6212504831dcbd0169 Mon Sep 17 00:00:00 2001
From: kevkevinpal <oapallikunnel at gmail.com>
Date: Fri, 25 Apr 2025 16:58:52 -0400
Subject: [PATCH] test: get rid of redundant TODO tag in fuzz tests

'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

Co-authored-by: Chand-ra <chandrapratap376 at gmail.com>
---
 compiler-rt/include/fuzzer/FuzzedDataProvider.h | 1 -
 1 file changed, 1 deletion(-)

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();
 



More information about the llvm-commits mailing list