This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26458] Passing a NULL char* into output stream now breaks the output stream
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Feb 2006 16:53:26 -0000
- Subject: [Bug libstdc++/26458] Passing a NULL char* into output stream now breaks the output stream
- References: <bug-26458-12260@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pcarlini at suse dot de 2006-02-24 16:53 -------
The change is certainly intended and the important point is that is not true
that there is no indication of the failure, quite to the contrary the badbit is
set. Try changing your test like this:
char *str = NULL;
cout << "Hello " << str;
assert( !cout.good() );
cout.clear();
cout << " there" << endl;
assert( cout.good() );
cout << "still dead?" << endl;
assert( cout.good() );
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Component|c++ |libstdc++
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26458