aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2001-06-13 01:14:42 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2001-06-13 01:14:42 +0000
commit7f3e3e0a228fc372a618017e23a2d25e1eb87b30 (patch)
tree2e387f3d89622e54a095fc0d367c189d125b68e3
parent695ac33fac9774cee59b6ce8cb20406339e3e54c (diff)
downloadgcc-7f3e3e0a228fc372a618017e23a2d25e1eb87b30.zip
gcc-7f3e3e0a228fc372a618017e23a2d25e1eb87b30.tar.gz
gcc-7f3e3e0a228fc372a618017e23a2d25e1eb87b30.tar.bz2
fpos.h (fpos::operator-): Don't return reference, return original, non-modified version.
2001-06-12 Benjamin Kosnik <bkoz@redhat.com> * include/bits/fpos.h (fpos::operator-): Don't return reference, return original, non-modified version. (fpos::operator+): Same. From-SVN: r43287
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/fpos.h20
2 files changed, 18 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5f3e3d7..ddc78e7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/fpos.h (fpos::operator-): Don't return reference,
+ return original, non-modified version.
+ (fpos::operator+): Same.
+
2001-06-12 Loren J. Rittle <ljrittle@acm.org>
libstdc++/2071
@@ -32,7 +38,7 @@
* config/os/solaris/solaris2.7/bits/os_defines.h
(_GLIBCPP_AVOID_FSEEK): Likewise.
-2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
+2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
* 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 7f43f9d..86eb5c3 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