fpos.h (fpos::operator-): Don't return reference, return original, non-modified version.
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 13 Jun 2001 01:50:27 +0000 (01:50 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 13 Jun 2001 01:50:27 +0000 (01:50 +0000)
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.
* testsuite/27_io/fpos.cc: Add test.

[[Split portion of a mixed commit.]]

From-SVN: r43290.2

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/fpos.cc

index ddc78e701d3cc2c14415b759fb7b2870aa0b7464..dac51a2a771a2d12e79f2ccd82ceee83010a9e48 100644 (file)
@@ -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  <ljrittle@acm.org>
 
        libstdc++/2071
index a5427fda1f605eb6e25fbbc6535158ba1fdb7f2a..6e852fd94865dbbd95669d51de605572e1e0b2ad 100644 (file)
@@ -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 );