[Bug libstdc++/123100] std::ostringstream:str() (r-value version) returns garbage

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 12 00:28:31 GMT 2025


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://en.cppreference.com/w/cpp/io/basic_ostringstream/str.html

3) Returns a string move-constructed from the underlying string. Equivalent to
return std::move(*rdbuf()).str();.

I think this is the correct behavior.


More information about the Gcc-bugs mailing list