diff options
Diffstat (limited to 'flang/lib/Semantics/check-call.cpp')
| -rw-r--r-- | flang/lib/Semantics/check-call.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/flang/lib/Semantics/check-call.cpp b/flang/lib/Semantics/check-call.cpp index 41c18a35f967..4939d8d64a99 100644 --- a/flang/lib/Semantics/check-call.cpp +++ b/flang/lib/Semantics/check-call.cpp @@ -811,7 +811,7 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy, // General implementation of F'23 15.5.2.5 note 5 // Adds a less specific error message for any copy-out that could overwrite // a unread value in the actual argument. - // Occurences of volatileOrAsyncNeedsTempDiagnosticIssued = true indicate a + // Occurences of `volatileOrAsyncNeedsTempDiagnosticIssued = true` indicate a // more specific error message has already been issued. We might be able to // clean this up by switching the coding style of MayNeedCopy to be more like // WhyNotDefinable. @@ -828,8 +828,8 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy, // If there are any cases where we don't need a copy and some other compiler // does, we issue a portability warning here. if (context.ShouldWarn(common::UsageWarning::Portability)) { - // Nag, GFortran, and NVFortran all error on this case, even though it is - // ok, prossibly as an over-restriction of F'23 C1548. + // 3 other compilers error on this case even though it is ok. + // Possibly as an over-restriction of F'23 C1548. if (!copyOutNeeded && !volatileOrAsyncNeedsTempDiagnosticIssued && (!dummyIsValue && (dummyIsAsynchronous || dummyIsVolatile)) && !(actualIsAsynchronous || actualIsVolatile) && @@ -842,7 +842,7 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy, actual.AsFortran(), dummyName, dummyIsAsynchronous ? "ASYNCHRONOUS" : "VOLATILE"); } - // Probably an over-restriction of F'23 15.5.2.5 note 5 + // Possibly an over-restriction of F'23 15.5.2.5 note 5 if (copyOutNeeded && !volatileOrAsyncNeedsTempDiagnosticIssued) { if ((dummyIsVolatile && !actualIsVolatile && !actualIsAsynchronous) || (dummyIsAsynchronous && !actualIsVolatile && !actualIsAsynchronous)) { @@ -1538,6 +1538,10 @@ static bool CheckElementalConformance(parser::ContextualMessages &messages, evaluate::SayWithDeclaration(messages, *wholeSymbol, "Whole assumed-size array '%s' may not be used as an argument to an elemental procedure"_err_en_US, wholeSymbol->name()); + } else if (IsAssumedRank(*wholeSymbol)) { + evaluate::SayWithDeclaration(messages, *wholeSymbol, + "Assumed-rank array '%s' may not be used as an argument to an elemental procedure"_err_en_US, + wholeSymbol->name()); } } if (auto argShape{evaluate::GetShape(context, *expr)}) { |
