This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26181] istream::operator>>(streambuf*) fails to set eofbit
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Feb 2006 17:29:12 -0000
- Subject: [Bug libstdc++/26181] istream::operator>>(streambuf*) fails to set eofbit
- References: <bug-26181-1186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from sebor at roguewave dot com 2006-02-09 17:29 -------
Here's my analysis copied from the post on the Sun C++ Forum.
According to 27.6.1.3, p36a, tellg() behaves as an unformatted input function
(as described in 27.6.1.3, p1).
>From 27.6.1.3, p1: Each unformatted input function begins execution by
constructing an object of class sentry with the default argument noskipws
(second) argument true. If the sentry object returns true, when converted to a
value of type bool, the function endeavors to obtain the requested input.
Since eofbit is set prior to calling tellg() the function must not "endeavor to
obtain the requested input." Hence it must fail.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26181