https://gcc.gnu.org/g:930b504b598864ba1774eb209a748ed76b6fc7c1
commit r15-9551-g930b504b598864ba1774eb209a748ed76b6fc7c1 Author: Tomasz KamiĆski <tkami...@redhat.com> Date: Thu Apr 17 10:33:10 2025 +0200 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: --- libstdc++-v3/include/std/format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index f3fd837897bd..e557e104d74d 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;