[all-commits] [llvm/llvm-project] 6e0a20: [flang] Catch name resolution error due to global ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Jan 15 12:40:58 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e0a2031f09819425480df8d44122530275b2347
      https://github.com/llvm/llvm-project/commit/6e0a2031f09819425480df8d44122530275b2347
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-01-15 (Mon, 15 Jan 2024)

  Changed paths:
    M flang/include/flang/Evaluate/characteristics.h
    M flang/lib/Evaluate/characteristics.cpp
    M flang/lib/Semantics/expression.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/call24.f90
    M flang/test/Semantics/call25.f90
    M flang/test/Semantics/local-vs-global.f90
    M flang/test/Semantics/reshape.f90
    M flang/test/Semantics/resolve09.f90

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list