Skip to content

Commit

Permalink
[flang] Fix check for coarray actual passed to implicit interface (ll…
Browse files Browse the repository at this point in the history
…vm#123836)

The check for a coarray actual argument being passed to a procedure with
an implicit interface was incorrect, yielding false positives for
coindexed objects. Fix.
  • Loading branch information
klausler authored Jan 27, 2025
1 parent 210e675 commit b16c989
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions flang/lib/Semantics/check-call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ static void CheckImplicitInterfaceArg(evaluate::ActualArgument &arg,
"Null pointer argument requires an explicit interface"_err_en_US);
} else if (auto named{evaluate::ExtractNamedEntity(*expr)}) {
const Symbol &symbol{named->GetLastSymbol()};
if (symbol.Corank() > 0) {
messages.Say(
"Coarray argument requires an explicit interface"_err_en_US);
}
if (evaluate::IsAssumedRank(symbol)) {
messages.Say(
"Assumed rank argument requires an explicit interface"_err_en_US);
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Semantics/call13.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ subroutine s(assumedRank, coarray, class, classStar, typeStar)
call implicit10(1, 2, keyword=3) ! 15.4.2.2(1)
!ERROR: Assumed rank argument requires an explicit interface
call implicit11(assumedRank) ! 15.4.2.2(3)(c)
!ERROR: Coarray argument requires an explicit interface
call implicit12(coarray) ! 15.4.2.2(3)(d)
call implicit12(coarray) ! ok
call implicit12a(coarray[1]) ! ok
!ERROR: Parameterized derived type actual argument requires an explicit interface
call implicit13(pdtx) ! 15.4.2.2(3)(e)
call implicit14(class) ! ok
Expand Down

0 comments on commit b16c989

Please sign in to comment.