https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123100
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
basic_stringbuf is implemented like:
```
_GLIBCXX_NODISCARD
__string_type
str() &&
{
if (char_type* __hi = _M_high_mark())
{
// Set length to end of character sequence and add null terminator.
_M_string._M_set_length(_M_high_mark() - this->pbase());
}
auto __str = std::move(_M_string);
_M_string.clear();
_M_sync(_M_string.data(), 0, 0);
return __str;
}
```
Maybe the type of __str is wrong ...