Explicitly cast elements of __not_fill to _CharT. Only '{' and ':' are 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. --- Tested on x86_64-linux. However I was not able to reproduce the warning, with either -fsigned-char or -funsigned-char. OK for trunk? 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 2668382c7ed..704721e6679 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; -- 2.49.0