Bug 46365 - libstdc++ 2.96 stringstream does not work correctly
Summary: libstdc++ 2.96 stringstream does not work correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: libstdc++
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-06-28 02:24 UTC by Felipe Bertrand
Modified: 2008-05-01 15:38 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-12-15 15:15:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Felipe Bertrand 2001-06-28 02:24:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12 i686; Nav)

Description of problem:
stringstream operator >> does not work when used after
operator <<. The following program does not print
"5" in g++ 2.96 with libstdc++ 2.96 (it works OK in
g++ 2.95, however):

#include <sstream>
main()
{
   stringstream ss;
   int i=0;
   ss << 5;
   ss >> i;
   cout << i <<endl;
}

How reproducible:
Always

Steps to Reproduce:
1. compile the small sample code provided
2. execute
3. the output is 0 (incorrect) intead of 5 (correct).

	

Actual Results:  The output of the compiled program is 0

Expected Results:  The output should be 5

Additional info:

Comment 1 Need Real Name 2002-05-02 15:11:07 UTC
I verified this problem also on updated Red Hat 7.0 and  
on Mandrake 8.2. 
So I guess it is a general problem of gcc 2.96 and a very nasty 
one. 
 
gcc 3.04, 3.1 and 2.95.x work fine.


Note You need to log in before you can comment on or make changes to this bug.