Skip to content

Commit a933bc7

Browse files
committed
[flang] Fix check for coarray actual passed to implicit interface
The check for a coarray actual argument being passed to a procedure with an implicit interface was incorrect, yielding false positives for coindexed objects and scalar coarrays. Fix, and correct a test.
1 parent 93fd72c commit a933bc7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

flang/lib/Semantics/check-call.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ static void CheckImplicitInterfaceArg(evaluate::ActualArgument &arg,
6767
"Null pointer argument requires an explicit interface"_err_en_US);
6868
} else if (auto named{evaluate::ExtractNamedEntity(*expr)}) {
6969
const Symbol &symbol{named->GetLastSymbol()};
70-
if (symbol.Corank() > 0) {
71-
messages.Say(
72-
"Coarray argument requires an explicit interface"_err_en_US);
73-
}
7470
if (evaluate::IsAssumedRank(symbol)) {
7571
messages.Say(
7672
"Assumed rank argument requires an explicit interface"_err_en_US);

flang/test/Semantics/call13.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ subroutine s(assumedRank, coarray, class, classStar, typeStar)
2222
call implicit10(1, 2, keyword=3) ! 15.4.2.2(1)
2323
!ERROR: Assumed rank argument requires an explicit interface
2424
call implicit11(assumedRank) ! 15.4.2.2(3)(c)
25-
!ERROR: Coarray argument requires an explicit interface
26-
call implicit12(coarray) ! 15.4.2.2(3)(d)
25+
call implicit12(coarray) ! ok
26+
call implicit12a(coarray[1]) ! ok
2727
!ERROR: Parameterized derived type actual argument requires an explicit interface
2828
call implicit13(pdtx) ! 15.4.2.2(3)(e)
2929
call implicit14(class) ! ok

0 commit comments

Comments
 (0)