[flang-commits] [flang] [flang] Whether a procedure's interface is explicit or not is not a d… (PR #82796)
via flang-commits
flang-commits at lists.llvm.org
Fri Feb 23 09:20:47 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-semantics
Author: Peter Klausler (klausler)
<details>
<summary>Changes</summary>
…istinguishing characteristic
We note whether a procedure's interface is explicit or implicit as an attribute of its characteristics, so that other semantics can be checked appropriately, but this internal attribute should not be used as a distinguishing characteristic in itself.
Fixes https://github.com/llvm/llvm-project/issues/81876.
---
Full diff: https://github.com/llvm/llvm-project/pull/82796.diff
3 Files Affected:
- (modified) flang/lib/Evaluate/characteristics.cpp (+1)
- (modified) flang/test/Semantics/call35.f90 (+1-1)
- (modified) flang/test/Semantics/null-init.f90 (+1-1)
``````````diff
diff --git a/flang/lib/Evaluate/characteristics.cpp b/flang/lib/Evaluate/characteristics.cpp
index 80b0f346c32d38..cf8b16c0ead6cd 100644
--- a/flang/lib/Evaluate/characteristics.cpp
+++ b/flang/lib/Evaluate/characteristics.cpp
@@ -1265,6 +1265,7 @@ bool Procedure::IsCompatibleWith(const Procedure &actual, std::string *whyNot,
}
Attrs differences{attrs ^ actualAttrs};
differences.reset(Attr::Subroutine); // dealt with specifically later
+ differences.reset(Attr::ImplicitInterface);
if (!differences.empty()) {
if (whyNot) {
auto sep{": "s};
diff --git a/flang/test/Semantics/call35.f90 b/flang/test/Semantics/call35.f90
index ff819481226d62..81a0ecb04da536 100644
--- a/flang/test/Semantics/call35.f90
+++ b/flang/test/Semantics/call35.f90
@@ -12,7 +12,7 @@ subroutine s2
subroutine s3
interface
- !WARNING: The global subprogram 'ext' is not compatible with its local procedure declaration (incompatible procedure attributes: ImplicitInterface)
+ !WARNING: The global subprogram 'ext' is not compatible with its local procedure declaration (distinct numbers of dummy arguments)
subroutine ext(n)
integer n
end
diff --git a/flang/test/Semantics/null-init.f90 b/flang/test/Semantics/null-init.f90
index ad3f91679a4272..ad2fa511f9ff3f 100644
--- a/flang/test/Semantics/null-init.f90
+++ b/flang/test/Semantics/null-init.f90
@@ -37,7 +37,7 @@ module m6
module m7
interface
- !WARNING: The external interface 'null' is not compatible with an earlier definition (incompatible procedure attributes: ImplicitInterface)
+ !WARNING: The external interface 'null' is not compatible with an earlier definition (function results have incompatible attributes)
function null() result(p)
integer, pointer :: p
end function
``````````
</details>
https://github.com/llvm/llvm-project/pull/82796
More information about the flang-commits
mailing list