This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51458] New: [4.7 Regression] Accepts invalid designated initializers
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Dec 2011 20:52:28 +0000
- Subject: [Bug c++/51458] New: [4.7 Regression] Accepts invalid designated initializers
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51458
Bug #: 51458
Summary: [4.7 Regression] Accepts invalid designated
initializers
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jakub@gcc.gnu.org
CC: jakub@gcc.gnu.org, jason@gcc.gnu.org,
reichelt@gcc.gnu.org
Depends on: 51229
+++ This bug was initially created as a clone of Bug #51229 +++
int a = { .foo = 6 };
int b = { [0] = 1 };
_Complex float c = { .foo = 0, 1 };
_Complex float d = { [0] = 0, 1 };
_Complex float e = { 0, .foo = 1 };
_Complex float f = { 0, [0] = 1 };
char g[] = { [7] = "abcd" };
should have all initializers rejected, but instead it ignores the designators
and accepts it. The C FE rejects all but the last one.