[libcxx-commits] [libcxx] [libc++] Suppress unsigned-integer-overflow warning in <charconv> (PR #225801)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 09:49:12 PDT 2026


================
@@ -323,7 +323,9 @@ template <template <typename> class Fn, typename... Ts>
 TEST_CONSTEXPR_CXX23 void
 run(type_list<Ts...>)
 {
-    int ls[sizeof...(Ts)] = {(Fn<Ts>{}(), 0)...};
+    // Avoid constant-folding the array initializer at compile time when Fn<Ts>{}() is constexpr.
----------------
hchataing wrote:

That's part of the AI help.
While I was try to get the minimal test case I could not reproduce the crash even though in other contexts (where I initially found the issue) I could. AI pointed out that the full test suite for charconv from_chars was evaluated at compile time, and proposed this fix.

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


More information about the libcxx-commits mailing list