[flang-commits] [PATCH] D134398: [flang] Don't resolve names in derived type definitions to generics

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Sep 21 16:45:25 PDT 2022


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

There's code in name resolution that handles resolution of references
that appear in the definitions of derived types -- it checks for
existing components in the type being defined, as well as for
non-parent components in its ancestors.  Special case code prevents
resolution of a name to the symbol of a procedure binding.  This
code needs to be extended so that names of generic procedures
are similarly prevented from shadowing symbols in the scope around
the type.


https://reviews.llvm.org/D134398

Files:
  flang/lib/Semantics/resolve-names.cpp


Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -2254,6 +2254,7 @@
   if (scope.IsDerivedType()) {
     if (Symbol * symbol{scope.FindComponent(name.source)}) {
       if (!symbol->has<ProcBindingDetails>() &&
+          !symbol->has<GenericDetails>() &&
           !symbol->test(Symbol::Flag::ParentComp)) {
         return Resolve(name, symbol);
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134398.462040.patch
Type: text/x-patch
Size: 509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220921/482d3023/attachment.bin>


More information about the flang-commits mailing list