From: Benjamin Kosnik Date: Wed, 13 Jun 2001 01:50:27 +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=9aaa9ee0262ab067d2a1c0ccb1726564df328cce;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. * testsuite/27_io/fpos.cc: Add test. [[Split portion of a mixed commit.]] From-SVN: r43290.2 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ddc78e701d3..dac51a2a771 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -3,7 +3,8 @@ * include/bits/fpos.h (fpos::operator-): Don't return reference, return original, non-modified version. (fpos::operator+): Same. - + * testsuite/27_io/fpos.cc: Add test. + 2001-06-12 Loren J. Rittle libstdc++/2071 diff --git a/libstdc++-v3/testsuite/27_io/fpos.cc b/libstdc++-v3/testsuite/27_io/fpos.cc index a5427fda1f6..6e852fd9486 100644 --- a/libstdc++-v3/testsuite/27_io/fpos.cc +++ b/libstdc++-v3/testsuite/27_io/fpos.cc @@ -107,12 +107,18 @@ void test02() pos03 = pos03 + off02; pos04 += off02; VERIFY( pos03 == pos04 ); + std::streampos pos05 = pos03; + std::streampos pos06 = pos03 + off02; + VERIFY ( pos05 == pos03 ); // q = p - o // p -= o pos03 = pos03 - off02; pos04 -= off02; VERIFY( pos03 == pos04 ); + std::streampos pos07 = pos03; + std::streampos pos08 = pos03 - off02; + VERIFY ( pos07 == pos03 ); // o = p - q VERIFY( 0 == pos03 - pos04 );