Bug 46365 - libstdc++ 2.96 stringstream does not work correctly
libstdc++ 2.96 stringstream does not work correctly
Product: Red Hat Linux
Classification: Retired
Component: libstdc++ (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2001-06-27 22:24 EDT by Felipe Bertrand
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-12-15 10:15:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Felipe Bertrand 2001-06-27 22:24:46 EDT
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>
   stringstream ss;
   int i=0;
   ss << 5;
   ss >> i;
   cout << i <<endl;

How reproducible:

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 11:11:07 EDT
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 
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.