From: Benjamin Kosnik Date: Wed, 13 Jun 2001 01:14:42 +0000 (+0000) Subject: fpos.h (fpos::operator-): Don't return reference, return original, non-modified version. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f3e3e0a228fc372a618017e23a2d25e1eb87b30;p=gcc.git fpos.h (fpos::operator-): Don't return reference, return original, non-modified version. 2001-06-12 Benjamin Kosnik * include/bits/fpos.h (fpos::operator-): Don't return reference, return original, non-modified version. (fpos::operator+): Same. From-SVN: r43287 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5f3e3d7be81..ddc78e701d3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2001-06-12 Benjamin Kosnik + + * include/bits/fpos.h (fpos::operator-): Don't return reference, + return original, non-modified version. + (fpos::operator+): Same. + 2001-06-12 Loren J. Rittle libstdc++/2071 @@ -32,7 +38,7 @@ * config/os/solaris/solaris2.7/bits/os_defines.h (_GLIBCPP_AVOID_FSEEK): Likewise. -2001-06-12 Benjamin Kosnik +2001-06-12 Benjamin Kosnik * acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Change to AC_TRY_COMPILE, so that the built compiler is checked, and diff --git a/libstdc++-v3/include/bits/fpos.h b/libstdc++-v3/include/bits/fpos.h index 7f43f9d36ab..86eb5c38e49 100644 --- a/libstdc++-v3/include/bits/fpos.h +++ b/libstdc++-v3/include/bits/fpos.h @@ -52,8 +52,8 @@ namespace std typedef _StateT __state_type; private: - __state_type _M_st; streamoff _M_off; + __state_type _M_st; public: __state_type @@ -64,10 +64,10 @@ namespace std // NB: The standard defines only the implicit copy ctor and the // previous two members. The rest is a "conforming extension". - fpos(): _M_st(__state_type()), _M_off(streamoff()) { } + fpos(): _M_off(streamoff()), _M_st(__state_type()) { } fpos(streamoff __off, __state_type __st = __state_type()) - : _M_st(__st), _M_off(__off) { } + : _M_off(__off), _M_st(__st) { } operator streamoff() const { return _M_off; } @@ -77,18 +77,20 @@ namespace std fpos& operator-=(streamoff __off) { _M_off -= __off; return *this; } - fpos& + fpos operator+(streamoff __off) { - fpos t(*this); - return t += __off; + fpos __t(*this); + __t += __off; + return __t; } - fpos& + fpos operator-(streamoff __off) { - fpos t(*this); - return t -= __off; + fpos __t(*this); + __t -= __off; + return __t; } bool