From 7c163acfdaf92d31020f9b922d5e0fd1ebb736df Mon Sep 17 00:00:00 2001 From: "Hans-Martin B. Jensen" <32485905+hmbj@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:02:31 +0100 Subject: [PATCH] Fix conversion warning in filesystem::path formatter (#3806) * Fix conversion warning in filesystem::path formatter Use template character type to eliminate MSVC conversion warning when formatting a wide chararacter path: fmt\std.h(140,49): warning C4244: '=': conversion from 'const Char' to 'char', possible loss of data * Review: use to_ascii instead --------- Co-authored-by: Hans-Martin B. Jensen --- include/fmt/std.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/std.h b/include/fmt/std.h index 205e6dd104a2..ff81da1ab9d4 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -137,7 +137,7 @@ template struct formatter { debug_ = true; ++it; } - if (it != end && (*it == 'g')) path_type_ = *it++; + if (it != end && (*it == 'g')) path_type_ = detail::to_ascii(*it++); return it; }