diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index abf3671e5b59..76bbb909058b 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -364,7 +364,7 @@ void write_codecvt(codecvt_result& out, string_view in, template auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc) -> OutputIt { - if (detail::use_utf8 && loc != get_classic_locale()) { + if (const_check(detail::use_utf8) && loc != get_classic_locale()) { // char16_t and char32_t codecvts are broken in MSVC (linkage errors) and // gcc-4. #if FMT_MSC_VERSION != 0 || \