From f68bff6084d68b44adcc29747904e47f9c16eb95 Mon Sep 17 00:00:00 2001 From: Henri Chataing Date: Tue, 12 Dec 2023 09:46:24 -0800 Subject: [PATCH] Fix isfinite implementation to be constexpr The implementation failed to be constexpr in the situation where: __cplusplus == 202002L && !defined(__cpp_lib_is_constant_evaluated) Fix #3745 --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 79bf5256..477f72d7 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2752,7 +2752,7 @@ template ::value&& has_isfinite::value)> FMT_CONSTEXPR20 bool isfinite(T value) { constexpr T inf = T(std::numeric_limits::infinity()); - if (is_constant_evaluated()) + if (is_constant_evaluated(true)) return !detail::isnan(value) && value < inf && value > -inf; return std::isfinite(value); }