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

--- Comment #12 from nightstrike <nightstrike at gmail dot com> ---
(In reply to Martin Sebor from comment #9)
> A similar test case not involving arrays:
> 
> $ cat z.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S
> -Wall -Wextra -o/dev/null -xc++ z.c
> typedef struct A {
>     int i;
>     struct { int a, b; } s;
> } A;
> 
> A a = { 1, .s = { 2, 3 } };
> A b = { .i = 1, .s = { 2, 3 } };
> A c = { .s = { 2, 3 }, .i = 1 };
> z.c:8:31: sorry, unimplemented: non-trivial designated initializers not
> supported
>  A c = { .s = { 2, 3 }, .i = 1 };
>                                ^
> 
> z.c:8:31: sorry, unimplemented: non-trivial designated initializers not
> supported


This fails differently:

b.cc:8:31: error: designator order for field 'A::i' does not match declaration
order in 'A'
 A c = { .s = { 2, 3 }, .i = 1 };
                               ^

But commenting out that line makes the rest work fine.

Reply via email to