diff options
Diffstat (limited to 'flang/lib/Semantics/check-call.cpp')
-rw-r--r-- | flang/lib/Semantics/check-call.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/flang/lib/Semantics/check-call.cpp b/flang/lib/Semantics/check-call.cpp index 597c280..ba68a0f 100644 --- a/flang/lib/Semantics/check-call.cpp +++ b/flang/lib/Semantics/check-call.cpp @@ -690,7 +690,8 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy, } } if (actualLastObject && actualLastObject->IsCoarray() && - IsAllocatable(*actualLastSymbol) && dummy.intent == common::Intent::Out && + dummy.attrs.test(characteristics::DummyDataObject::Attr::Allocatable) && + dummy.intent == common::Intent::Out && !(intrinsic && evaluate::AcceptsIntentOutAllocatableCoarray( intrinsic->name))) { // C846 @@ -703,12 +704,14 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy, // Problems with polymorphism are caught in the callee's definition. if (scope) { std::optional<parser::MessageFixedText> undefinableMessage; - if (dummy.intent == common::Intent::Out) { - undefinableMessage = - "Actual argument associated with INTENT(OUT) %s is not definable"_err_en_US; - } else if (dummy.intent == common::Intent::InOut) { + DefinabilityFlags flags{DefinabilityFlag::PolymorphicOkInPure}; + if (dummy.intent == common::Intent::InOut) { + flags.set(DefinabilityFlag::AllowEventLockOrNotifyType); undefinableMessage = "Actual argument associated with INTENT(IN OUT) %s is not definable"_err_en_US; + } else if (dummy.intent == common::Intent::Out) { + undefinableMessage = + "Actual argument associated with INTENT(OUT) %s is not definable"_err_en_US; } else if (context.ShouldWarn(common::LanguageFeature:: UndefinableAsynchronousOrVolatileActual)) { if (dummy.attrs.test( @@ -722,7 +725,6 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy, } } if (undefinableMessage) { - DefinabilityFlags flags{DefinabilityFlag::PolymorphicOkInPure}; if (isElemental) { // 15.5.2.4(21) flags.set(DefinabilityFlag::VectorSubscriptIsOk); } @@ -1622,8 +1624,8 @@ static void CheckImage_Index(evaluate::ActualArguments &arguments, evaluate::GetShape(arguments[1]->UnwrapExpr())}) { if (const auto *coarrayArgSymbol{UnwrapWholeSymbolOrComponentDataRef( arguments[0]->UnwrapExpr())}) { - const auto coarrayArgCorank = coarrayArgSymbol->Corank(); - if (const auto subArrSize = evaluate::ToInt64(*subArrShape->front())) { + auto coarrayArgCorank{coarrayArgSymbol->Corank()}; + if (auto subArrSize{evaluate::ToInt64(*subArrShape->front())}) { if (subArrSize != coarrayArgCorank) { messages.Say(arguments[1]->sourceLocation(), "The size of 'SUB=' (%jd) for intrinsic 'image_index' must be equal to the corank of 'COARRAY=' (%d)"_err_en_US, |