This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/9827: Regression: ostream::operator<<(int) doesn't report output errors.


>Number:         9827
>Category:       libstdc++
>Synopsis:       Regression: ostream::operator<<(int) doesn't report output errors.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 09:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     peturr02 at ru dot is
>Release:        gcc version 3.4 20030222 (experimental)
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
ostream::operator<<(int) doesn't change the streams error state if streambuf::overflow returns eof. This works correctly in gcc-3.2.1.
>How-To-Repeat:
See attachment.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="sputnbug.cc"
Content-Disposition: inline; filename="sputnbug.cc"

#include <ostream>
#include <streambuf>

#undef NDEBUG
#include <cassert>

class Buf : public std::streambuf
{
};

int main()
{
	using namespace std;

	Buf buf;
	ostream stream (&buf);

	stream << 1;
	assert(!stream.good());

	return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]