summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-06-22 15:01:21 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-06-22 15:01:21 +0000
commit99f5fc937f1042b24188a92bf2fe40f151d023bb (patch)
treee6d79ef283c5acabcb0240b997af2e020fdf8231 /libcxx/include
parent30952b200b7f5393ababd0907998fa78f2917a7d (diff)
downloadbcm5719-llvm-99f5fc937f1042b24188a92bf2fe40f151d023bb.tar.gz
bcm5719-llvm-99f5fc937f1042b24188a92bf2fe40f151d023bb.zip
Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361
llvm-svn: 240286
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/ostream4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index a7af2994b6b..f55fd40856e 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -1004,7 +1004,7 @@ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
sentry __s(*this);
- if (__s)
+ if (!this->fail())
{
if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1))
this->setstate(ios_base::failbit);
@@ -1018,7 +1018,7 @@ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
{
sentry __s(*this);
- if (__s)
+ if (!this->fail())
{
if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::out) == pos_type(-1))
this->setstate(ios_base::failbit);
OpenPOWER on IntegriCloud