diff options
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/istream | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/istream b/libcxx/include/istream index 72b2004dd53..7b481864250 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -1189,7 +1189,11 @@ basic_istream<_CharT, _Traits>::peek() #endif // _LIBCPP_NO_EXCEPTIONS sentry __sen(*this, true); if (__sen) + { __r = this->rdbuf()->sgetc(); + if (traits_type::eq_int_type(__r, traits_type::eof())) + this->setstate(ios_base::eofbit); + } #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) |