This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/26181] istream::operator>>(streambuf*) fails to set eofbit



------- 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


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