From abcdc26a81d183e3256ce2751530a971ef6c4191 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Wed, 4 Jan 2023 12:08:06 +0000 Subject: [PATCH] [libc] get_table_negative cannot be constexpr GCC complains about if conditions not being constant expressions. As-is get_table_negative cannot be marked constexpr. Differential Revision: https://reviews.llvm.org/D140967 --- libc/src/__support/float_to_string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/src/__support/float_to_string.h b/libc/src/__support/float_to_string.h index e9814843a5dd..da1defa7646a 100644 --- a/libc/src/__support/float_to_string.h +++ b/libc/src/__support/float_to_string.h @@ -130,8 +130,8 @@ get_table_positive(int exponent, size_t i, const size_t constant) { // calculations. // The formula being used looks more like this: // floor(10^(9*(-i)) * 2^(c_0 + (-e))) % (10^9 * 2^c_0) -constexpr inline cpp::UInt -get_table_negative(int exponent, size_t i, const size_t constant) { +inline cpp::UInt get_table_negative(int exponent, size_t i, + const size_t constant) { constexpr size_t INT_SIZE = 1024; int shift_amount = constant - exponent; cpp::UInt num(1);