https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92968
Bug ID: 92968 Summary: C style struct initialization fail to compile in g++ when initializing array fields Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mytbk920423 at gmail dot com Target Milestone: --- The following program cannot be compiled with g++ but can be compiled with clang++ or any C compiler including gcc. typedef struct AStruct { int a[2]; } AStruct; int main() { AStruct t0 = { .a[0] = 5 }; }