From 19aae768bd2aeaf47c70040c0feb4a4efe9c5ea7 Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Fri, 27 May 2022 20:31:21 +0400 Subject: [PATCH] Visual Studio 2022: fmt/format.h(1526,27): warning C4127: conditional expression is constant #2908 --- 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 43403027ba1c..fdb2cf442a4c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1523,7 +1523,7 @@ auto find_escape(const Char* begin, const Char* end) -> find_escape_result { for (; begin != end; ++begin) { uint32_t cp = static_cast>(*begin); - if (sizeof(Char) == 1 && cp >= 0x80) continue; + if (const_check(sizeof(Char) == 1) && cp >= 0x80) continue; if (needs_escape(cp)) return {begin, begin + 1, cp}; } return {begin, nullptr, 0};