Red Hat Bugzilla – Bug 46365
libstdc++ 2.96 stringstream does not work correctly
Last modified: 2008-05-01 11:38:00 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):
ss << 5;
ss >> i;
cout << i <<endl;
Steps to Reproduce:
1. compile the small sample code provided
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
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.