Skip to content
Unverified Commit 6e0a2031 authored by Peter Klausler's avatar Peter Klausler Committed by GitHub
Browse files

[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.
parent 691770ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment