[committed] libstdc++: Fix -Wsign-compare warning in std::string::resize_for_overwrite
Checks
Commit Message
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(-)
@@ -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();
@@ -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();