From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7869 invoked by alias); 25 Oct 2002 09:06:02 -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 7837 invoked by uid 71); 25 Oct 2002 09:06:01 -0000 Resent-Date: 25 Oct 2002 09:06:01 -0000 Resent-Message-ID: <20021025090601.7836.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, adamwilkshire@hotmail.com Received: (qmail 8577 invoked by uid 61); 25 Oct 2002 08:56:00 -0000 Message-Id: <20021025085600.8573.qmail@sources.redhat.com> Date: Fri, 25 Oct 2002 02:06:00 -0000 From: adamwilkshire@hotmail.com Reply-To: adamwilkshire@hotmail.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8348: fail() flag is set in istringstream when eof() flag is set ! X-SW-Source: 2002-10/txt/msg00983.txt.bz2 List-Id: >Number: 8348 >Category: c++ >Synopsis: fail() flag is set in istringstream when eof() flag is set ! >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Oct 25 02:06:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Adam Wilkshire >Release: g++ 3.2 >Organization: >Environment: Solaris. Reading specs from /opt/global/pkg/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.7/3.2/specs Configured with: ../gcc-3.2/configure --prefix=/opt/global/pkg/ : (reconfigured) ../gcc-3.2/configure --prefix=/opt/global/pkg/gcc-3.2 Thread model: posix gcc version 3.2 >Description: fail() returns true when an operation on istringstream succeeds and reaches the end. >How-To-Repeat: run the program without arguments, tellg() fails because of the flag ... >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="temp8.cc" Content-Disposition: inline; filename="temp8.cc" #include #include #include int main(int argc,char** argv){ std::string num1("555"); std::istringstream iss(num1); std::istream::pos_type pos1=iss.tellg(); int asNum=0; iss >> asNum; std::istream::pos_type pos2=iss.tellg(); std::streamoff off1=pos2-pos1; std::cout<<"have "<