This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16227] New: ICE, -Wall, initialisation of global array of aggregates
- From: "jan at etpmod dot phys dot tue dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2004 13:47:18 -0000
- Subject: [Bug c++/16227] New: ICE, -Wall, initialisation of global array of aggregates
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The code below gives an ICE with today's CVS head when compiled with -Wall:
jan@nbjapan:$ g++ -c -Wall t.cpp
t.cpp: In function `void __static_initialization_and_destruction_0(int, int)':
t.cpp:7: internal compiler error: Segmentation fault
* If the array is an automatic variable instead, everything is fine.
* If s is a const char* the problem disappears
* Without -Wall everything is fine (!).
* I looked at the .ii, reducing this case is a PITA. IIRC there are some
automated means for that? Otherwise I will have to give it a spin myself.
Here's the code.
#include <string>
struct A {
std::string s;
};
A a[] = { "foo" };
--
Summary: ICE, -Wall, initialisation of global array of aggregates
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jan at etpmod dot phys dot tue dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16227