http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60724
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jim Michaels from comment #0) > ostream-bug.cpp:3:18: error: within this context > std::ostream o; > ^ > did the c++ standard change drastically for iostreams in the last month? No, it's always been like that. std::ostream provides an interface, not a concrete implementation, so you cannot just declare an ostream and expect it to work (where would it write to?!) std::ostream is meant to be used as a base class of conrete stream types, such as ofstream (which writes to a file) or ostringstream (which writes to a memory buffer). > if you are going to quote me to use a streambuf or stringbuf, those are > protected too. For the same reason. You need to use a derived streambuf, such as filebuf or stringbuf, or write your own derived streambuf. > if you are going to quote an example using a filebuf, I am > not working with a file at this point. I just want to output strings. Output to *where*? If you want to write to the console, then use std::cout, or open a std::ofstream to the relevant device (I think it's called "CON" in Windows). (In reply to Jim Michaels from comment #4) > problem is, those solutions seem to be copyrighted and made impossible to > use for commercial purposes. I have no idea what you're talking about, but it's irrelevant to GCC. Please stop changing the resolution to FIXED, there is no GCC bug to fix, your code is not valid C++, so your bug report is invalid. GCC is correctly implementing the standard here, it is not the GCC project's responsibility to fix the design of your program.