On Mon, 8 Mar 2021, Tobias Burnus wrote: > On 08.03.21 08:45, Richard Biener wrote: > > On Fri, 5 Mar 2021, Tobias Burnus wrote: > >> Nested functions are permitted for C but not C++ as extension. > >> They are also permitted for Fortran, which generates DECL_CONTEXT > >> == NAMESPACE_DECL for module variables. > >> > >> That causes the gcc_assert (decl_function_context (decl) == info->context) > >> to fail in tree-nested.c's lookup_field_for_decl. [...] > > I think the bug is elsewhere. We're not expecting non-local > > (non-auto) variables to be queried with lookup_field_for_decl. [...] > > Now changed by doing the > 'decl_function_context (decl) == info->context' > check in the caller's condition, which matches the rest of the file. > > Thanks for the suggestion. > > OK for mainline? GCC 10?
OK for trunk and GCC 10 after a while. Richard. > Tobias > > ----------------- > Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München > Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank > Thürauf > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)