From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6535 invoked by alias); 23 Apr 2002 13:06:07 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6490 invoked by uid 71); 23 Apr 2002 13:06:05 -0000 Date: Tue, 23 Apr 2002 06:06:00 -0000 Message-ID: <20020423130605.6488.qmail@sources.redhat.com> To: jason@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jason Merrill Subject: Re: libstdc++/6414: g++ 3.1 tellg() regression within last week Reply-To: Jason Merrill X-SW-Source: 2002-04/txt/msg01190.txt.bz2 List-Id: The following reply was made to PR libstdc++/6414; it has been noted by GNATS. From: Jason Merrill To: libstdc++@gcc.gnu.org Cc: gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/6414: g++ 3.1 tellg() regression within last week Date: Tue, 23 Apr 2002 14:00:44 +0100 --=-=-= Missed a spot. Testing now; I'll apply it to trunk and branch if it passes. 2002-04-23 Jason Merrill PR libstdc++/6414 * include/bits/fstream.tcc (basic_filebuf::seekoff): Adjust return value properly in the trivial case. * testsuite/27_io/istream_seeks.cc (test04): Make sure that tellg() returns the right value after a read. --=-=-= Content-Type: text/x-patch Content-Disposition: inline Index: include/bits/fstream.tcc =================================================================== RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/fstream.tcc,v retrieving revision 1.30 diff -c -p -r1.30 fstream.tcc *** include/bits/fstream.tcc 22 Apr 2002 20:28:04 -0000 1.30 --- include/bits/fstream.tcc 23 Apr 2002 12:55:24 -0000 *************** namespace std *** 567,573 **** else { __ret = _M_file.seekoff(__off, ios_base::cur, __mode); ! __ret += max(_M_out_cur, _M_in_cur) - _M_buf; } } _M_last_overflowed = false; --- 567,573 ---- else { __ret = _M_file.seekoff(__off, ios_base::cur, __mode); ! __ret += _M_in_cur - _M_filepos; } } _M_last_overflowed = false; Index: testsuite/27_io/istream_seeks.cc =================================================================== RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/istream_seeks.cc,v retrieving revision 1.10 diff -c -p -r1.10 istream_seeks.cc *** testsuite/27_io/istream_seeks.cc 7 Aug 2001 03:38:33 -0000 1.10 --- testsuite/27_io/istream_seeks.cc 23 Apr 2002 12:55:25 -0000 *************** void test04(void) *** 229,235 **** VERIFY( pos05 == pos06 + off_type(10) ); VERIFY( state01 == state02 ); pos06 = is03.tellg(); ! VERIFY( pos05 == pos06 ); #ifdef DEBUG_ASSERT assert(test); --- 229,242 ---- VERIFY( pos05 == pos06 + off_type(10) ); VERIFY( state01 == state02 ); pos06 = is03.tellg(); ! VERIFY( pos05 == pos06 ); ! ! // libstdc++/6414 ! if01.seekg(0, std::ios_base::beg); ! pos01 = if01.tellg(); ! if01.peek(); ! pos02 = if01.tellg(); ! VERIFY( pos02 == pos01 ); #ifdef DEBUG_ASSERT assert(test); --=-=-=--