[flang-commits] [flang] 656cebb - [flang] Allow non-definable actual arguments to volatile/asynchronous dummy arguments
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Thu Aug 25 15:15:56 PDT 2022
Author: Peter Klausler
Date: 2022-08-25T15:10:46-07:00
New Revision: 656cebb49d14fd59fd786ea320603650c93ffee7
URL: https://github.com/llvm/llvm-project/commit/656cebb49d14fd59fd786ea320603650c93ffee7
DIFF: https://github.com/llvm/llvm-project/commit/656cebb49d14fd59fd786ea320603650c93ffee7.diff
LOG: [flang] Allow non-definable actual arguments to volatile/asynchronous dummy arguments
Semantic checking for calls was requiring an actual argument that corresponds
to an ASYNCHRONOUS or VOLATILE dummy argument to be definable, but this is not
a constraint or requirement in the standard and doesn't even make sense
as a warning; these two attributes are "scopable" in the context of BLOCK
constructs. Remove the checks and adjust the tests.
Differential Revision: https://reviews.llvm.org/D132684
Added:
Modified:
flang/lib/Semantics/check-call.cpp
flang/test/Semantics/call03.f90
Removed:
################################################################################
diff --git a/flang/lib/Semantics/check-call.cpp b/flang/lib/Semantics/check-call.cpp
index 77db69051843..d89bf93ce27a 100644
--- a/flang/lib/Semantics/check-call.cpp
+++ b/flang/lib/Semantics/check-call.cpp
@@ -387,17 +387,13 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
reason = "INTENT(OUT)";
} else if (dummy.intent == common::Intent::InOut) {
reason = "INTENT(IN OUT)";
- } else if (dummyIsAsynchronous) {
- reason = "ASYNCHRONOUS";
- } else if (dummyIsVolatile) {
- reason = "VOLATILE";
}
if (reason && scope) {
bool vectorSubscriptIsOk{isElemental || dummyIsValue}; // 15.5.2.4(21)
if (auto why{WhyNotModifiable(
messages.at(), actual, *scope, vectorSubscriptIsOk)}) {
if (auto *msg{messages.Say(
- "Actual argument associated with %s %s must be definable"_err_en_US, // C1158
+ "Actual argument associated with %s %s must be definable"_err_en_US,
reason, dummyName)}) {
msg->Attach(*why);
}
diff --git a/flang/test/Semantics/call03.f90 b/flang/test/Semantics/call03.f90
index 511c2d3d1011..ad98e4e629ae 100644
--- a/flang/test/Semantics/call03.f90
+++ b/flang/test/Semantics/call03.f90
@@ -284,10 +284,8 @@ subroutine test12 ! 15.5.2.4(21)
call intentout_arr(a(j))
!ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'x=' must be definable
call intentinout_arr(a(j))
- !ERROR: Actual argument associated with ASYNCHRONOUS dummy argument 'x=' must be definable
- call asynchronous_arr(a(j))
- !ERROR: Actual argument associated with VOLATILE dummy argument 'x=' must be definable
- call volatile_arr(a(j))
+ call asynchronous_arr(a(j)) ! ok
+ call volatile_arr(a(j)) ! ok
end subroutine
subroutine coarr(x)
More information about the flang-commits
mailing list