Have basic_istream seekg, putback and unget first clear eofbit. Fixes http://llvm...
authorHoward Hinnant <hhinnant@apple.com>
Fri, 24 Aug 2012 22:03:03 +0000 (22:03 +0000)
committerHoward Hinnant <hhinnant@apple.com>
Fri, 24 Aug 2012 22:03:03 +0000 (22:03 +0000)
llvm-svn: 162608

libcxx/include/istream

index 7312425..b48f856 100644 (file)
@@ -1263,6 +1263,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
+        this->clear(this->rdstate() & ~ios_base::eofbit);
         sentry __sen(*this, true);
         if (__sen)
         {
@@ -1290,6 +1291,7 @@ basic_istream<_CharT, _Traits>::unget()
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
+        this->clear(this->rdstate() & ~ios_base::eofbit);
         sentry __sen(*this, true);
         if (__sen)
         {
@@ -1368,6 +1370,7 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
+        this->clear(this->rdstate() & ~ios_base::eofbit);
         sentry __sen(*this, true);
         if (__sen)
             if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))