public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49355] New: new T({""}) crashes G++ when struct T { std::string foobar };
@ 2011-06-10  1:08 peter.schmidt-nielsen at cba dot mit.edu
  2011-06-10  9:38 ` [Bug c++/49355] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: peter.schmidt-nielsen at cba dot mit.edu @ 2011-06-10  1:08 UTC (permalink / raw)
  To: gcc-bugs

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

           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=24482
Minimal test case producing the (un)desired behavior, and temporary files.

The following code:

#include <string>

struct T {
    std::string foobar;
};

T* x = 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 
test_case.cpp:9: warning: extended initializer lists only available with
-std=c++0x or -std=gnu++0x
test_case.cpp:9: warning: extended initializer lists only available with
-std=c++0x or -std=gnu++0x
test_case.cpp: In function ‘void __static_initialization_and_destruction_0(int,
int)’:
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 <file:///usr/share/doc/gcc-4.4/README.Bugs> 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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-01  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-10  1:08 [Bug c++/49355] New: new T({""}) crashes G++ when struct T { std::string foobar }; peter.schmidt-nielsen at cba dot mit.edu
2011-06-10  9:38 ` [Bug c++/49355] " rguenth at gcc dot gnu.org
2011-06-10 10:00 ` redi at gcc dot gnu.org
2011-06-30 21:47 ` jason at gcc dot gnu.org
2011-07-01  0:04 ` jason at gcc dot gnu.org
2011-07-01  0:08 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).