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
This commit is contained in:
Petur Runolfsson 2003-09-22 18:29:56 +00:00 committed by Paolo Carlini
parent 0ba529cab4
commit 89ec0c4ba6
2 changed files with 8 additions and 10 deletions

View File

@ -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

View File

@ -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;
}