From: Tomasz KamiƄski Date: Thu, 17 Apr 2025 08:33:10 +0000 (+0200) Subject: libstdc++: Fixed signed comparision in _M_parse_fill_and_align [PR119840] X-Git-Tag: basepoints/gcc-16~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=930b504b598864ba1774eb209a748ed76b6fc7c1;p=thirdparty%2Fgcc.git libstdc++: Fixed signed comparision in _M_parse_fill_and_align [PR119840] Explicitly cast elements of __not_fill to _CharT. Only '{' and ':' are used as `__not_fill`, so they are never negative. PR libstdc++/119840 libstdc++-v3/ChangeLog: * include/std/format (_M_parse_fill_and_align): Cast elements of __not_fill to _CharT. --- diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index f3fd837897b..e557e104d74 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -555,8 +555,8 @@ namespace __format constexpr iterator _M_parse_fill_and_align(iterator __first, iterator __last, string_view __not_fill) noexcept { - for (char c : __not_fill) - if (*__first == c) + for (char __c : __not_fill) + if (*__first == static_cast<_CharT>(__c)) return __first; using namespace __unicode;