[libcxx-commits] [libcxx] [libc++] Fix basic_string not allowing max_size() elements to be stored (PR #125423)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 5 08:31:31 PST 2025


================
@@ -2558,7 +2558,7 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait
     __throw_length_error();
----------------
ldionne wrote:

There is another internal use of `max_size()` above in `basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace`. That one wasn't changed, which makes me think we probably still have a bug and we are almost certainly missing some test coverage.

Could you audit all the places where we call `max_size()` in our string implementation and make sure we don't have similar defficiencies elsewhere?

https://github.com/llvm/llvm-project/pull/125423


More information about the libcxx-commits mailing list