[flang] Catch name resolution error due to global scoping (#77683)
In CALL FOO PRINT *, ABS(FOO) we currently resolve the first FOO to a global external subprogram, but then the second FOO is treated as an implicitly typed local variable. This happens because the name FOO is not present in the local scope. Fix by adding FOO to the local scope using a place-holding HostAssocDetails symbol whose existence prevents the creation of another FOO in the local scope. The symbol stored in the parser::Name parse tree nodes or used in typed expressions will all continue to point to the global external subprogram. Resolves llvm-test-suite/Fortran/gfortran/regression/pr71859.f90.
Loading
Please sign in to comment