From e1ffa7655d6cb6686ffe4b78658b5f401de62bbc Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Thu, 20 Oct 2022 19:49:53 +0500 Subject: [PATCH] Fix warning: conditional expression is constant. (#3150) Signed-off-by: Vladislav Shchapov Signed-off-by: Vladislav Shchapov --- include/fmt/chrono.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index ef6a29903d07..8cecb1624f7d 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -212,7 +212,8 @@ To safe_duration_cast(std::chrono::duration from, } const auto min1 = (std::numeric_limits::min)() / Factor::num; - if (!std::is_unsigned::value && count < min1) { + if (detail::const_check(!std::is_unsigned::value) && + count < min1) { ec = 1; return {}; }