[PATCH] D120971: [flang] Allow IMPLICIT NONE(EXTERNAL) with GenericDetails

Mike K via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 02:45:30 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd2bcb0a129f1: [flang] Allow IMPLICIT NONE(EXTERNAL) with GenericDetails (authored by FruitClover).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120971

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


Index: flang/test/Semantics/implicit12.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/implicit12.f90
@@ -0,0 +1,8 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+use iso_c_binding, only: c_ptr, c_associated
+implicit none(external)
+type (c_ptr) :: cptr
+if (.not. c_associated (cptr)) then
+   return
+end if
+end
Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -6495,7 +6495,9 @@
     if (!SetProcFlag(name, *symbol, flag)) {
       return; // reported error
     }
-    CheckImplicitNoneExternal(name.source, *symbol);
+    if (!symbol->has<GenericDetails>()) {
+      CheckImplicitNoneExternal(name.source, *symbol);
+    }
     if (symbol->has<SubprogramDetails>() &&
         symbol->attrs().test(Attr::ABSTRACT)) {
       Say(name, "Abstract interface '%s' may not be called"_err_en_US);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120971.422789.patch
Type: text/x-patch
Size: 1015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220414/0677cccc/attachment.bin>


More information about the llvm-commits mailing list