[all-commits] [llvm/llvm-project] f8dbe7: [flang] Don't resolve component names to component...

Peter Klausler via All-commits all-commits at lists.llvm.org
Sun Oct 30 13:42:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8dbe79cc673439db4b90cdcabcffc79348a2ca1
      https://github.com/llvm/llvm-project/commit/f8dbe79cc673439db4b90cdcabcffc79348a2ca1
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-10-30 (Sun, 30 Oct 2022)

  Changed paths:
    M flang/docs/Extensions.md
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/resolve104.f90
    M flang/test/Semantics/symbol14.f90

  Log Message:
  -----------
  [flang] Don't resolve component names to components in derived-type definition scope

We implemented 19.3.4p1 literally in name resolution:

  A component name has the scope of its derived-type definition. Outside the type definition,
  it may also appear within a designator of a component of a structure of that type or as a
  component keyword in a structure constructor for that type.

and within the derived-type definition would resolve the "bare"
names of components in specification inquiries and other contexts to
those components, not to any symbols in the enclosing scopes.

It turns out that most Fortran compilers resolve only "bare" names thus
when they are type parameters, and the names of data and procedure components
do not shadow exterior symbols.  Adjust name resolution to follow that
precedent rather than what seems to be clear language in the standard.

Differential Revision: https://reviews.llvm.org/D136984




More information about the All-commits mailing list