Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Whether a procedure's interface is explicit or not is not a d… #82796

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

klausler
Copy link
Contributor

…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 #81876.

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Feb 23, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Feb 23, 2024

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

…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 #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 --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

Copy link
Contributor

@vzakhari vzakhari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@klausler klausler force-pushed the bug81876 branch 3 times, most recently from 69f1891 to 5ebbba7 Compare March 1, 2024 19:05
…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 llvm#81876.
@klausler klausler merged commit 1c530b3 into llvm:main Mar 1, 2024
3 of 4 checks passed
@klausler klausler deleted the bug81876 branch March 1, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
3 participants