diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1857,7 +1857,7 @@ size_type __reserve) { if (__reserve > max_size()) - this->__throw_length_error(); + __throw_length_error(); pointer __p; if (__reserve < __min_cap) { @@ -2040,7 +2040,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c) { if (__n > max_size()) - this->__throw_length_error(); + __throw_length_error(); pointer __p; if (__n < __min_cap) { @@ -2091,7 +2091,7 @@ { size_type __str_sz = __str.size(); if (__pos > __str_sz) - this->__throw_out_of_range(); + __throw_out_of_range(); __init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos)); #if _LIBCPP_DEBUG_LEVEL == 2 if (!__libcpp_is_constant_evaluated()) @@ -2107,7 +2107,7 @@ { size_type __str_sz = __str.size(); if (__pos > __str_sz) - this->__throw_out_of_range(); + __throw_out_of_range(); __init(__str.data() + __pos, __str_sz - __pos); #if _LIBCPP_DEBUG_LEVEL == 2 if (!__libcpp_is_constant_evaluated()) @@ -2192,7 +2192,7 @@ { size_type __sz = static_cast(_VSTD::distance(__first, __last)); if (__sz > max_size()) - this->__throw_length_error(); + __throw_length_error(); pointer __p; if (__sz < __min_cap) { @@ -2567,7 +2567,7 @@ { size_type __sz = __str.size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return assign(__str.data() + __pos, _VSTD::min(__n, __sz - __pos)); } @@ -2584,7 +2584,7 @@ __self_view __sv = __t; size_type __sz = __sv.size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return assign(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos)); } @@ -2753,7 +2753,7 @@ { size_type __sz = __str.size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return append(__str.data() + __pos, _VSTD::min(__n, __sz - __pos)); } @@ -2769,7 +2769,7 @@ __self_view __sv = __t; size_type __sz = __sv.size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return append(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos)); } @@ -2790,7 +2790,7 @@ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::insert received nullptr"); size_type __sz = size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); size_type __cap = capacity(); if (__cap - __sz >= __n) { @@ -2927,7 +2927,7 @@ { size_type __str_sz = __str.size(); if (__pos2 > __str_sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return insert(__pos1, __str.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2)); } @@ -2944,7 +2944,7 @@ __self_view __sv = __t; size_type __str_sz = __sv.size(); if (__pos2 > __str_sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return insert(__pos1, __sv.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2)); } @@ -3005,7 +3005,7 @@ _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::replace received nullptr"); size_type __sz = size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); __n1 = _VSTD::min(__n1, __sz - __pos); size_type __cap = capacity(); if (__cap - __sz + __n1 >= __n2) @@ -3052,7 +3052,7 @@ { size_type __sz = size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); __n1 = _VSTD::min(__n1, __sz - __pos); size_type __cap = capacity(); value_type* __p; @@ -3104,7 +3104,7 @@ { size_type __str_sz = __str.size(); if (__pos2 > __str_sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return replace(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2)); } @@ -3121,7 +3121,7 @@ __self_view __sv = __t; size_type __str_sz = __sv.size(); if (__pos2 > __str_sz) - this->__throw_out_of_range(); + __throw_out_of_range(); return replace(__pos1, __n1, __sv.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2)); } @@ -3191,7 +3191,8 @@ basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::erase(size_type __pos, size_type __n) { - if (__pos > size()) this->__throw_out_of_range(); + if (__pos > size()) + __throw_out_of_range(); if (__n == npos) { __erase_to_end(__pos); } else { @@ -3307,7 +3308,7 @@ basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __requested_capacity) { if (__requested_capacity > max_size()) - this->__throw_length_error(); + __throw_length_error(); #if _LIBCPP_STD_VER > 17 // Reserve never shrinks as of C++20. @@ -3413,7 +3414,7 @@ basic_string<_CharT, _Traits, _Allocator>::at(size_type __n) const { if (__n >= size()) - this->__throw_out_of_range(); + __throw_out_of_range(); return (*this)[__n]; } @@ -3422,7 +3423,7 @@ basic_string<_CharT, _Traits, _Allocator>::at(size_type __n) { if (__n >= size()) - this->__throw_out_of_range(); + __throw_out_of_range(); return (*this)[__n]; } @@ -3468,7 +3469,7 @@ { size_type __sz = size(); if (__pos > __sz) - this->__throw_out_of_range(); + __throw_out_of_range(); size_type __rlen = _VSTD::min(__n, __sz - __pos); traits_type::copy(__s, data() + __pos, __rlen); return __rlen; @@ -3912,7 +3913,7 @@ _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr"); size_type __sz = size(); if (__pos1 > __sz || __n2 == npos) - this->__throw_out_of_range(); + __throw_out_of_range(); size_type __rlen = _VSTD::min(__n1, __sz - __pos1); int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2)); if (__r == 0) @@ -3976,7 +3977,7 @@ size_type __pos2, size_type __n2) const { - return compare(__pos1, __n1, __self_view(__str), __pos2, __n2); + return compare(__pos1, __n1, __self_view(__str), __pos2, __n2); } template