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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess lambdas really need to have all the needed parameters captured, and for
VLAs that likely includes not just the VLAs themselves, but their sizes as
well.
That is something that needs to be done in the FE somewhere, because lambdas
are handled only at that point.  Wonder if that means also creating another set
of the VLA types for the lambda with TYPE_SIZE{,_UNIT} that map to an
artificial field and that the capturing code initializes it with the
TYPE_SIZE{,_UNIT} (i.e. the SAVE_EXPR it has).  For normal nested functions (C
or Fortran) this is tree-nested.c's job and I think we handle it there already
right, because it is after gimplification and so the needed vars are exposed.

Or reject capturing VLAs (with a sorry) until that is done.

Reply via email to