Tested x86_64-linux. Pushed to trunk. -- >8 --
libstdc++-v3/ChangeLog: * include/bits/basic_string.tcc (resize_for_overwrite): Fix -Wsign-compare warning. * include/bits/cow_string.h (resize_for_overwrite): Likewise. --- libstdc++-v3/include/bits/basic_string.tcc | 2 +- libstdc++-v3/include/bits/cow_string.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 2c17d258bfe..caeddaf2f5b 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -611,7 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_assert(__gnu_cxx::__is_integer_nonstrict<decltype(__r)>::__value, "resize_and_overwrite operation must return an integer"); #endif - _GLIBCXX_DEBUG_ASSERT(__r >= 0 && __r <= __n); + _GLIBCXX_DEBUG_ASSERT(__r >= 0 && size_type(__r) <= __n); __term._M_r = size_type(__r); if (__term._M_r > __n) __builtin_unreachable(); diff --git a/libstdc++-v3/include/bits/cow_string.h b/libstdc++-v3/include/bits/cow_string.h index b78aa74fbfa..087ddf81dd8 100644 --- a/libstdc++-v3/include/bits/cow_string.h +++ b/libstdc++-v3/include/bits/cow_string.h @@ -3800,7 +3800,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_assert(__gnu_cxx::__is_integer_nonstrict<decltype(__r)>::__value, "resize_and_overwrite operation must return an integer"); #endif - _GLIBCXX_DEBUG_ASSERT(__r >= 0 && __r <= __n); + _GLIBCXX_DEBUG_ASSERT(__r >= 0 && size_type(__r) <= __n); __term._M_r = size_type(__r); if (__term._M_r > __n) __builtin_unreachable(); -- 2.46.1