https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78718
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #4 from kargl at gcc dot gnu.org --- (In reply to Jim MacArthur from comment #1) > Confirmed on latest trunk (x8664). Looks like it has the wrong namespace > when trying to find 'z'. I'm looking into it. I haven't looked at gdb output or namespaces, yet. Do note that the 'z' in the program unit 'p' is a distinct entity from the 'z' that appears in the RESULT clause in the function declaration. Adding IMPLICIT NONE to the program 'p' gives a.f90:6:28: function f() result(z) 1 Error: Function result 'z' at (1) has no IMPLICIT type or locally declaring 'z' in function 'f' allows the code to compile. In short, the local 'z' should block the host association of the 'z' from 'p'.