https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55227

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-01-15
                 CC|                            |msebor at gcc dot gnu.org
             Blocks|                            |60323, 55606
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.3, 5.1.0, 6.0

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
This still fails both ways with 6.0.  Related to (or perhaps even the same
problem as) c++/60323 and c++/55606.

$ cat x.c && /home/msebor/build/gcc-trunk-svn/gcc/xgcc
-B/home/msebor/build/gcc-trunk-svn/gcc -S -Wall -Wextra -Wpedantic -xc++ x.c
struct S { char a[25]; };

struct S s1 = { a : "aaaa" };
struct S s2 = { .a = "aaaa" };
x.c:3:15: warning: ISO C++ does not allow designated initializers [-Wpedantic]
 struct S s1 = { a : "aaaa" };
               ^

x.c:3:28: error: C99 designator ‘a’ outside aggregate initializer
 struct S s1 = { a : "aaaa" };
                            ^

x.c:4:15: warning: ISO C++ does not allow C99 designated initializers
[-Wpedantic]
 struct S s2 = { .a = "aaaa" };
               ^

x.c:4:29: error: C99 designator ‘a’ outside aggregate initializer
 struct S s2 = { .a = "aaaa" };
                             ^


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606
[Bug 55606] sorry, unimplemented: non-trivial designated initializers not
supported
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60323
[Bug 60323] incorrect usage of designated initializers with struct which
includes flexible array

Reply via email to