This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51430] New: [4.7 Regression] ICE with array as static const member
- From: "reichelt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Dec 2011 00:39:34 +0000
- Subject: [Bug c++/51430] New: [4.7 Regression] ICE with array as static const member
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51430
Bug #: 51430
Summary: [4.7 Regression] ICE with array as static const member
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: reichelt@gcc.gnu.org
The following invalid code snippet triggers an ICE on trunk:
==================================
template<int> struct A
{
static const int x[] = 0;
};
A<0> a;
==================================
bug.cc:3:26: error: invalid in-class initialization of static data member of
non-integral type 'const int []'
bug.cc:3:26: error: initializer fails to determine size of 'A<<anonymous> >::x'
bug.cc: In instantiation of 'struct A<0>':
bug.cc:6:26: required from here
bug.cc:3:26: internal compiler error: in strip_array_domain, at cp/typeck.c:890
Please submit a full bug report, [etc.]