aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Chataing <henrichataing@google.com>2023-12-12 22:15:28 +0000
committerHenri Chataing <henrichataing@google.com>2023-12-12 22:15:28 +0000
commit82e1a7c9713fbfa48f81e88010bbcbcf7910868f (patch)
treec240dde9d240553cf8b6e02ad6c6fe03856df145
parentdeee43a80c1f2b0a7ced0565426e3e6828589962 (diff)
downloadfmtlib-82e1a7c9713fbfa48f81e88010bbcbcf7910868f.tar.gz
Fix isfinite implementation to be constexpr
The implementation failed to be constexpr in the situation where: __cplusplus == 202002L && !defined(__cpp_lib_is_constant_evaluated) Test: mmm external/fmtlib Change-Id: I7d958716c159b8be7b3da2fd971c5dcb25381ff1
-rw-r--r--include/fmt/format.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 4104d91f..c8e1c46d 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2746,7 +2746,7 @@ template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value&&
has_isfinite<T>::value)>
FMT_CONSTEXPR20 bool isfinite(T value) {
constexpr T inf = T(std::numeric_limits<double>::infinity());
- if (is_constant_evaluated())
+ if (is_constant_evaluated(true))
return !detail::isnan(value) && value < inf && value > -inf;
return std::isfinite(value);
}