From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21161 invoked by alias); 10 Jun 2011 01:08:57 -0000 Received: (qmail 21151 invoked by uid 22791); 10 Jun 2011 01:08:56 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jun 2011 01:08:42 +0000 From: "peter.schmidt-nielsen at cba dot mit.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/49355] New: new T({""}) crashes G++ when struct T { std::string foobar }; X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: peter.schmidt-nielsen at cba dot mit.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Fri, 10 Jun 2011 01:08:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00825.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49355 Summary: new T({""}) crashes G++ when struct T { std::string foobar }; Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: peter.schmidt-nielsen@cba.mit.edu Created attachment 24482 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D24482 Minimal test case producing the (un)desired behavior, and temporary files. The following code: #include struct T { std::string foobar; }; T* x =3D new T({""}); Produces the following behavior: peter@magma:~/tmp/a$ g++ --version g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. peter@magma:~/tmp/a$ g++ -Wall -Wextra test_case.cpp=20 test_case.cpp:9: warning: extended initializer lists only available with -std=3Dc++0x or -std=3Dgnu++0x test_case.cpp:9: warning: extended initializer lists only available with -std=3Dc++0x or -std=3Dgnu++0x test_case.cpp: In function =E2=80=98void __static_initialization_and_destru= ction_0(int, int)=E2=80=99: test_case.cpp:9: internal compiler error: in lower_stmt, at gimple-low.c:408 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. I listed the affected version as 4.7.0 because when I went on IRC, I was informed by a user there that 4.7.0 20110524 (experimental) [trunk revision 174141] is still affected. System information: peter@magma:~$ uname -a Linux magma 2.6.31-23-generic #75-Ubuntu SMP Fri Mar 18 18:16:06 UTC 2011 x86_64 GNU/Linux peter@magma:~$ cat /etc/issue Ubuntu 9.10 \n \l Attached is the code and the temps.