[flang-commits] [PATCH] D119566: [flang] Fix edge case in USE-associated generics

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Feb 11 10:52:43 PST 2022


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

It is generally an error when a USE-associated name clashes
with a name defined locally, but not in all cases; a generic
interface can be both USE-associated and locally defined.
This works, but not when there is also a local subprogram
with the same name, which is valid when that subprogram is
a specific of the local generic.  A bogus error issues at
the point of the USE because name resolution will have already
defined a symbol for the local subprogram.

The solution is to collect the names of local generics when
creating the program tree, and then create their symbols as
well if their names are also local subprograms, prior to any
USE association processing.


https://reviews.llvm.org/D119566

Files:
  flang/lib/Semantics/program-tree.cpp
  flang/lib/Semantics/program-tree.h
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/resolve18.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119566.407953.patch
Type: text/x-patch
Size: 6000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220211/7440a91e/attachment-0001.bin>


More information about the flang-commits mailing list