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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
>From what I can see, when doing pushdecl of the extern a declaration the
VAR_DECL is pushed into incomplete_vars, then when seeing the definition
pushdecl is called again and during duplicate_decls it is turned into no longer
DECL_EXTERNAL, but the type hasn't been instantiated yet.  Then start_decl
calls start_decl_1 which calls complete_decl and that sees an incomplete type
that can't be completed and errors.
One way out of this might be not call layout_var_decl if !COMPLETE_TYPE_P
(type).
Another one might be to let start_decl_1 record in some global variable that it
is processing (if it is) a variable with [] array and let complete_vars skip
that var.

Reply via email to