diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-10 19:22:46 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-10 19:22:46 +0900 |
commit | 8b02a27fc607ebc54c5a811188b3cea5063564e7 (patch) | |
tree | c1ca7d4acca553301204ebb83383aa87cb59311a /flang/lib/Semantics/expression.cpp | |
parent | 694a772457b2999b7bd68625a16bf0755e95dcdb (diff) | |
parent | 397ac44f623f891d8f05d6673a95984ac0a26671 (diff) | |
download | llvm-users/chapuni/cov/merge/mcdcsort.zip llvm-users/chapuni/cov/merge/mcdcsort.tar.gz llvm-users/chapuni/cov/merge/mcdcsort.tar.bz2 |
Merge branch 'main' into users/chapuni/cov/merge/mcdcsortusers/chapuni/cov/merge/mcdcsort
Diffstat (limited to 'flang/lib/Semantics/expression.cpp')
-rw-r--r-- | flang/lib/Semantics/expression.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp index c2eb17c..3ec6f38 100644 --- a/flang/lib/Semantics/expression.cpp +++ b/flang/lib/Semantics/expression.cpp @@ -1506,9 +1506,9 @@ MaybeExpr ExpressionAnalyzer::Analyze(const parser::CoindexedNamedObject &x) { if (cosubsOk && !reversed.empty()) { int numCosubscripts{static_cast<int>(cosubscripts.size())}; const Symbol &symbol{reversed.front()}; - if (numCosubscripts != symbol.Corank()) { + if (numCosubscripts != GetCorank(symbol)) { Say("'%s' has corank %d, but coindexed reference has %d cosubscripts"_err_en_US, - symbol.name(), symbol.Corank(), numCosubscripts); + symbol.name(), GetCorank(symbol), numCosubscripts); } } for (const auto &imageSelSpec : @@ -2536,6 +2536,15 @@ static bool CheckCompatibleArgument(bool isElemental, return false; }, [&](const characteristics::DummyProcedure &dummy) { + if ((dummy.attrs.test( + characteristics::DummyProcedure::Attr::Optional) || + dummy.attrs.test( + characteristics::DummyProcedure::Attr::Pointer)) && + IsBareNullPointer(expr)) { + // NULL() is compatible with any dummy pointer + // or optional dummy procedure. + return true; + } if (!expr || !IsProcedurePointerTarget(*expr)) { return false; } |