[flang-commits] [PATCH] D132684: [flang] Allow non-definable actual arguments to volatile/asynchronous dummy arguments
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu Aug 25 10:54:06 PDT 2022
klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.
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.
https://reviews.llvm.org/D132684
Files:
flang/lib/Semantics/check-call.cpp
flang/test/Semantics/call03.f90
Index: flang/test/Semantics/call03.f90
===================================================================
--- flang/test/Semantics/call03.f90
+++ flang/test/Semantics/call03.f90
@@ -284,10 +284,8 @@
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)
Index: flang/lib/Semantics/check-call.cpp
===================================================================
--- flang/lib/Semantics/check-call.cpp
+++ flang/lib/Semantics/check-call.cpp
@@ -387,17 +387,13 @@
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);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132684.455652.patch
Type: text/x-patch
Size: 1676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220825/f449e9dc/attachment.bin>
More information about the flang-commits
mailing list