This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51458] New: [4.7 Regression] Accepts invalid designated initializers


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]