Bug 46365

Summary: libstdc++ 2.96 stringstream does not work correctly
Product: [Retired] Red Hat Linux Reporter: Felipe Bertrand <fbertrand>
Component: libstdc++Assignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: christian
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-15 15:15:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.