https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119037

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Most likely max_size in std::basic_string should be something like:

```
      ///  Returns the size() of the largest possible %string.
      _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
      size_type
      max_size() const _GLIBCXX_NOEXCEPT
      {
        const size_t __diffmax
          = __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_CharT);
        const size_t __allocmax = _Alloc_traits::max_size(_M_get_allocator());
        return (std::max)(_S_local_capacity, (std::min)(__diffmax, __allocmax))
- 1;
      }
```

That is taking into account the _S_local_capacity which does not need to call
the allocator.

Reply via email to