[flang-commits] [PATCH] D134403: [flang] A separate module procedure must inherit interface attributes

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Sep 23 11:44:01 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG086234927a05: [flang] A separate module procedure must inherit interface attributes (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134403/new/

https://reviews.llvm.org/D134403

Files:
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/separate-mp02.f90


Index: flang/test/Semantics/separate-mp02.f90
===================================================================
--- flang/test/Semantics/separate-mp02.f90
+++ flang/test/Semantics/separate-mp02.f90
@@ -298,3 +298,16 @@
     real :: x
   end
 end
+
+module m8
+  interface
+    pure elemental module subroutine s1
+    end subroutine
+  end interface
+end module
+submodule(m8) sm8
+ contains
+  !Ensure no spurious error about mismatching attributes
+  module procedure s1
+  end procedure
+end submodule
Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -3664,6 +3664,7 @@
       currScope().erase(symbol->name());
       newDetails.set_result(*currScope().CopySymbol(details.result()));
     }
+    newSymbol.attrs() |= symbol->attrs();
   }
   return true;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134403.462567.patch
Type: text/x-patch
Size: 915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220923/9626cc5e/attachment.bin>


More information about the flang-commits mailing list