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
* [Bug c++/49355] new T({""}) crashes G++ when struct T { std::string foobar };
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 ` rguenth at gcc dot gnu.org
2011-06-10 10:00 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-10 9:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49355
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.06.10 09:37:35
Ever Confirmed|0 |1
Known to fail| |4.4.5, 4.5.3, 4.6.0, 4.7.0
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-10 09:37:35 UTC ---
Confirmed. 4.3 rejected the code, so does the EDG frontend of ICC 12.0:
t.C(7): error: expected an expression
T* x = new T({""});
so not sure if it is valid code or not.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49355] new T({""}) crashes G++ when struct T { std::string foobar };
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
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-10 10:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49355
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-10 10:00:00 UTC ---
it's only valid in C++0x
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49355] new T({""}) crashes G++ when struct T { std::string foobar };
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
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-30 21:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49355
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |jason at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49355] new T({""}) crashes G++ when struct T { std::string foobar };
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
` (2 preceding siblings ...)
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
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-07-01 0:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49355
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-07-01 00:03:39 UTC ---
Author: jason
Date: Fri Jul 1 00:03:34 2011
New Revision: 175736
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175736
Log:
PR c++/49355
* tree.c (stabilize_init): Handle aggregate initialization.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/initlist54.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49355] new T({""}) crashes G++ when struct T { std::string foobar };
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
` (3 preceding siblings ...)
2011-07-01 0:04 ` jason at gcc dot gnu.org
@ 2011-07-01 0:08 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-07-01 0:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49355
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.7.0
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-07-01 00:07:34 UTC ---
Fixed for 4.7.
^ 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).