From 9e2e299c5a770b385c33bb5fc3f345bb18104050 Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Mon, 20 Jan 2020 12:06:39 +0300 Subject: [PATCH] Fixed format.h(2351,1): warning C4127: conditional expression is constant --- include/fmt/format.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/fmt/format.h b/include/fmt/format.h index 76e4fac6..ef4c2c32 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2348,7 +2348,12 @@ template struct precision_adapter { template FMT_CONSTEXPR const Char* next_code_point(const Char* begin, const Char* end) { + +#ifdef __cpp_if_constexpr + if (constexpr (sizeof(Char) != 1) || (*begin & 0x80) == 0) return begin + 1; +#else if (sizeof(Char) != 1 || (*begin & 0x80) == 0) return begin + 1; +#endif do { ++begin; } while (begin != end && (*begin & 0xc0) == 0x80);