diff --git a/include/istream b/include/istream index 168a4d06..0bcc7eea 100644 --- a/include/istream +++ b/include/istream @@ -1407,6 +1407,7 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir) try { #endif // _LIBCPP_NO_EXCEPTIONS + this->clear(this->rdstate() & ~ios_base::eofbit); sentry __sen(*this, true); if (__sen) { diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp index 73f3da1c..3cedf919 100644 --- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp @@ -71,4 +71,13 @@ int main() assert(is.fail()); assert(seekoff_called == 4); } + { + testbuf sb(" 123456789"); + std::istream is(&sb); + is.setstate(std::ios_base::eofbit); + assert(is.eof()); + is.seekg(5, std::ios_base::beg); + assert(is.good()); + assert(!is.eof()); + } } diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index 966cc149..d30d1cb3 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -159,7 +159,7 @@ 2219INVOKE-ing a pointer to member with a reference_wrapper as the object expressionKona 2224Ambiguous status of access to non-live objectsKona 2234assert() should allow usage in constant expressionsKona - 2244Issue on basic_istream::seekgKonaPatch Ready + 2244Issue on basic_istream::seekgKonaComplete 2250Follow-up On Library Issue 2207Kona 2259Issues in 17.6.5.5 rules for member functionsKonaComplete 2273regex_match ambiguityKona