https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123100
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Jonathan Wakely <[email protected]>: https://gcc.gnu.org/g:90d77d9323773f5e465c73397f2aa3456310b9f8 commit r15-11162-g90d77d9323773f5e465c73397f2aa3456310b9f8 Author: Jonathan Wakely <[email protected]> Date: Mon Dec 15 10:25:52 2025 +0000 libstdc++: Fix std::basic_stringbuf::str()&& [PR123100] When basic_stringbuf::setbuf has been called we need to copy the contents of the buffer into _M_string first, before returning that. libstdc++-v3/ChangeLog: PR libstdc++/123100 * include/std/sstream (basic_stringbuf::str()&&): Handle the case where _M_string is not being used for the buffer. * testsuite/27_io/basic_stringbuf/str/char/123100.cc: New test. Reviewed-by: Tomasz KamiÅski <[email protected]> (cherry picked from commit a94bd31fd80b6a7efbe4d4c81ff195f7d81c3813)
