[flang-commits] [flang] d2bcb0a - [flang] Allow IMPLICIT NONE(EXTERNAL) with GenericDetails
Mike Kashkarov via flang-commits
flang-commits at lists.llvm.org
Thu Apr 14 02:45:25 PDT 2022
Author: Mike Kashkarov
Date: 2022-04-14T12:45:21+03:00
New Revision: d2bcb0a129f1e60d291fe967426e3686d9ea0587
URL: https://github.com/llvm/llvm-project/commit/d2bcb0a129f1e60d291fe967426e3686d9ea0587
DIFF: https://github.com/llvm/llvm-project/commit/d2bcb0a129f1e60d291fe967426e3686d9ea0587.diff
LOG: [flang] Allow IMPLICIT NONE(EXTERNAL) with GenericDetails
Restrictions of IMPLICIT NONE(EXTERNAL) prohibits usage of c_associated from
iso_c_binding (with explicit interface) without external definiton - relax
associated check.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D120971
Added:
flang/test/Semantics/implicit12.f90
Modified:
flang/lib/Semantics/resolve-names.cpp
Removed:
################################################################################
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index cf7bebcfd656b..5b63f842d63f3 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -6495,7 +6495,9 @@ void ResolveNamesVisitor::HandleProcedureName(
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);
diff --git a/flang/test/Semantics/implicit12.f90 b/flang/test/Semantics/implicit12.f90
new file mode 100644
index 0000000000000..bff2cb1545b13
--- /dev/null
+++ b/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
More information about the flang-commits
mailing list