re PR libstdc++/9659 (3.3/3.4 seekoff overload problem with optimization)

2003-02-11  Scott Snyder  <snyder@fnal.gov>

	PR libstdc++/9659
	* include/bits/fstream.tcc (seekoff): Avoid operator+
	for pos_type.

From-SVN: r62712
This commit is contained in:
Scott Snyder 2003-02-11 19:53:51 +00:00 committed by Paolo Carlini
parent 6f0d35660b
commit 74db146134
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2003-02-11 Scott Snyder <snyder@fnal.gov>
PR libstdc++/9659
* include/bits/fstream.tcc (seekoff): Avoid operator+
for pos_type.
2003-02-11 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/9320

View File

@ -456,9 +456,12 @@ namespace std
pos_type __tmp =
_M_file.seekoff(__off, ios_base::cur, __mode);
if (__tmp >= 0)
// Seek successful.
__ret = __tmp +
std::max(this->_M_out_cur, this->_M_in_cur) - _M_filepos;
{
// Seek successful.
__ret = __tmp;
__ret +=
std::max(this->_M_out_cur, this->_M_in_cur) - _M_filepos;
}
}
}
_M_last_overflowed = false;