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

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 12 09:29:48 GMT 2025


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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to M Welinder from comment #0)
>   std::ostringstream os;
> 
>   char buf[100] = {};
>   os.rdbuf()->pubsetbuf(buf, sizeof buf);

What do you expect this to do?

"Effects: implementation-defined, except that setbuf(0, 0) has no effect."


More information about the Gcc-bugs mailing list