From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7283 invoked by alias); 23 Dec 2002 15:56:32 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7237 invoked by uid 71); 23 Dec 2002 15:56:30 -0000 Resent-Date: 23 Dec 2002 15:56:30 -0000 Resent-Message-ID: <20021223155630.7236.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, O.Kullmann@Swansea.ac.uk Received: (qmail 28808 invoked by uid 61); 23 Dec 2002 15:50:16 -0000 Message-Id: <20021223155016.28807.qmail@sources.redhat.com> Date: Mon, 23 Dec 2002 07:56:00 -0000 From: O.Kullmann@Swansea.ac.uk Reply-To: O.Kullmann@Swansea.ac.uk To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9042: Initialisation of std::ostringstream does not work correctly X-SW-Source: 2002-12/txt/msg01236.txt.bz2 List-Id: >Number: 9042 >Category: c++ >Synopsis: Initialisation of std::ostringstream does not work correctly >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Mon Dec 23 07:56:29 PST 2002 >Closed-Date: >Last-Modified: >Originator: Oliver Kullmann >Release: g++ -v >Organization: >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) >Description: #include #include int main() { std::ostringstream s("abcd", std::ios_base::app); s << "xy"; std::cout << s.str() << "\n"; // outputs "xycd" (instead of the correct "abcdxy") } >How-To-Repeat: compile and run; >Fix: Use only the default constructor of std::ostringstream, and then use the inserter. >Release-Note: >Audit-Trail: >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