This bug is back with gcc 4.1.1. I was told it works ok with 4.0.3

+++ This bug was initially created as a clone of Bug #9042 +++

#include <sstream>
#include <iostream>

int main() {
  std::ostringstream s("abcd", std::ios_base::app);
  s << "xy";
  std::cout << s.str() << "\n";
  // outputs "xycd" (instead of the correct "abcdxy")
}

Release:
g++ -v

Environment:
Linux, Suse 8.0
 g++ -v
Reading specs from /opt/experimental/lib/gcc-lib/i486-suse-linux/3.0.4/specs
Configured with: ../configure --enable-threads=posix --enable-long-long
--prefix=/opt/experimental
+--with-local-prefix=/usr/local --enable-languages=c,c++,f77,objc,java
--disable-nls --enable-shared
+i486-suse-linux
Thread model: posix
gcc version 3.0.4 (SuSE)

How-To-Repeat:
compile and run;

Unformatted:
 Reading specs from /opt/experimental/lib/gcc-lib/i486-suse-linux/3.0.4/specs
 Configured with: ../configure --enable-threads=posix --enable-long-long
--prefix=/opt/experimental
 +--with-local-prefix=/usr/local --enable-languages=c,c++,f77,objc,java --disa


-- 
           Summary: Initialisation of std::ostringstream does not work
                    correctly
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eric_jrdn2 at yahoo dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29035

Reply via email to