From dbef2bb1d0453026b49af6d55aa99bcec776ff35 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Sun, 25 Oct 2015 18:31:51 +0000 Subject: [PATCH] Fix LWG#2244: basic_istream::seekg git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@251246 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/istream | 1 + .../input.streams/istream.unformatted/seekg_off.pass.cpp | 9 +++++++++ www/cxx1z_status.html | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) 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