summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetur Runolfsson <peturr02@ru.is>2003-09-22 18:29:56 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2003-09-22 18:29:56 +0000
commit89ec0c4ba6ae53e5b675ee027fe3529dc6c11f62 (patch)
treeb0c90cd5bd52de72eaa65ec52aacc0e9d21e6b2b
parent0ba529cab41a77f965bd06ced41a285ee517e626 (diff)
downloadgcc-89ec0c4ba6ae53e5b675ee027fe3529dc6c11f62.tar.gz
istream.tcc (basic_istream::read, [...]): Avoid redundant setstate(failbit) calls when sentry::operator bool() returns false.
2003-09-22 Petur Runolfsson <peturr02@ru.is> * include/bits/istream.tcc (basic_istream::read, basic_istream::readsome, basic_istream::putback, basic_istream::unget, operator>>(basic_istream, CharT)): Avoid redundant setstate(failbit) calls when sentry::operator bool() returns false. From-SVN: r71662
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/istream.tcc10
2 files changed, 8 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 959e136f30d..9caf65ac7e1 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2003-09-22 Petur Runolfsson <peturr02@ru.is>
+
+ * include/bits/istream.tcc (basic_istream::read,
+ basic_istream::readsome, basic_istream::putback,
+ basic_istream::unget, operator>>(basic_istream, CharT)):
+ Avoid redundant setstate(failbit) calls when sentry::operator bool()
+ returns false.
+
2003-09-22 Carlo Wood <carlo@alinoe.com>
PR libstdc++/12365
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index 543d94d0f1d..e6677c523a4 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -798,8 +798,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return *this;
}
@@ -834,8 +832,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return _M_gcount;
}
@@ -868,8 +864,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return *this;
}
@@ -902,8 +896,6 @@ namespace std
__throw_exception_again;
}
}
- else
- this->setstate(ios_base::failbit);
return *this;
}
@@ -1014,8 +1006,6 @@ namespace std
__throw_exception_again;
}
}
- else
- __in.setstate(ios_base::failbit);
return __in;
}