public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/9563: ostream::sentry returns true after a failed preparation
@ 2003-02-12 13:00 paolo
0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-02-12 13:00 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, paolo, sebor
Synopsis: ostream::sentry returns true after a failed preparation
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Wed Feb 12 13:00:51 2003
Responsible-Changed-Why:
Patching.
State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Wed Feb 12 13:00:51 2003
State-Changed-Why:
Confirmed. Seems easy to fix: just move over the logic already
present in istream::sentry.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9563
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: libstdc++/9563: ostream::sentry returns true after a failed preparation
@ 2003-02-12 20:10 paolo
0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-02-12 20:10 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, paolo, sebor
Synopsis: ostream::sentry returns true after a failed preparation
State-Changed-From-To: analyzed->closed
State-Changed-By: paolo
State-Changed-When: Wed Feb 12 20:10:12 2003
State-Changed-Why:
Fixed for trunk and 3.3.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9563
^ permalink raw reply [flat|nested] 3+ messages in thread
* libstdc++/9563: ostream::sentry returns true after a failed preparation
@ 2003-02-04 2:26 sebor
0 siblings, 0 replies; 3+ messages in thread
From: sebor @ 2003-02-04 2:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 9563
>Category: libstdc++
>Synopsis: ostream::sentry returns true after a failed preparation
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 04 02:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: sebor@roguewave.com
>Release: 3.2.1
>Organization:
>Environment:
>Description:
According to the requirements on the ostream::sentry ctor below, the program below should exit with the status of 0. It exits with 1 with gcc 3.2.1, indicating that the sentry ctor fails to check the state of the stream after the former has completed the preparation.
Regards
Martin
27.6.2.3:
-2- If os.good() is nonzero, prepares for formatted
or unformatted output. If os.tie() is not a null
pointer, calls os.tie()->flush().
-3- If, after any preparation is completed, os.good()
is true, ok_ == true otherwise, ok_ == false.
>How-To-Repeat:
$ cat t.cpp; g++ t.cpp && ./a.out ; echo $?
#include <ostream>
#include <streambuf>
struct buf: std::streambuf
{
std::ios *io_;
buf (std::ios *io): io_ (io) { }
virtual int sync () {
io_->setstate (std::ios::failbit);
return 0;
}
};
int main ()
{
buf b (0);
std::ostream strm (&b);
buf tb (&strm);
std::ostream tied (&tb);
strm.tie (&tied);
std::ostream::sentry s (strm);
return s;
}
1
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-02-12 20:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-12 13:00 libstdc++/9563: ostream::sentry returns true after a failed preparation paolo
-- strict thread matches above, loose matches on Subject: below --
2003-02-12 20:10 paolo
2003-02-04 2:26 sebor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).