https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105510
--- Comment #6 from Matheus Afonso Martins Moreira ---
Also ran into this issue today, also involving compound literals in nested
structure initialization macros. Because clang accepts this, it compiled fine
on my development machine but failed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105510
Andy Shevchenko changed:
What|Removed |Added
CC||andy.shevchenko at gmail dot
com
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105510
--- Comment #4 from joseph at codesourcery dot com ---
We have a documented extension:
As a GNU extension, GCC allows initialization of objects with static
storage
duration by compound literals (which is not possible in ISO C99 because
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105510
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105510
--- Comment #2 from 。 <570070308 at qq dot com> ---
(In reply to Richard Biener from comment #1)
> As a workaround it works with
>
> struct Test t=(struct Test){1, {3, 4}};
>
> I don't think it your way of writing is actually valid though.
Yes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105510
Richard Biener changed:
What|Removed |Added
Summary|[12] error: initializer |error: initializer element