This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/12297] New: istream::sentry::sentry() handles eof() incorrectly.
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2003 08:36:26 -0000
- Subject: [Bug libstdc++/12297] New: istream::sentry::sentry() handles eof() incorrectly.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12297
Summary: istream::sentry::sentry() handles eof() incorrectly.
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peturr02 at ru dot is
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
According to the resolution to DR 195:
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#195
basic_istream::sentry::sentry() should call setstate(failbit | eofbit) if
is.rdbuf()->sgetc() or is.rdbuf()->sbumpc() return eof(). Currently, the
sentry constructor calls is.setstate(eofbit) and later calls
is.setstate(failbit). This means that failbit will not be set in is.rdstate()
as it should if the call to setstate(eofbit) throws an exception.