https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109113
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |8.1.0 Last reconfirmed| |2023-03-13 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: ``` struct menu_item_s { void (*fn)(void); }; struct menu_list_s { int _a; struct menu_item_s items[]; }; struct menu_s { int _a; struct menu_list_s items[]; }; void fn(void); const struct menu_list_s FILE_MENU = { .items = { { fn }, } }; struct menu_s WINDOW_MENU = { .items = { FILE_MENU, FILE_MENU, }, }; ``` Note GCC 7 and before used to reject it with: ``` <source>:20:9: error: initializer element is not constant FILE_MENU, ^~~~~~~~~ <source>:20:9: note: (near initialization for 'WINDOW_MENU.items[0]') ```