Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flang/lib/Semantics/check-call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,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)}) {
Expand Down
13 changes: 13 additions & 0 deletions flang/test/Semantics/elemental03.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
!RUN: %python %S/test_errors.py %s %flang_fc1
module m
contains
elemental real function f(x)
real, intent(in) :: x
f = x
end
subroutine s(a)
real a(..)
!ERROR: Assumed-rank array 'a' may not be used as an argument to an elemental procedure
print *, f(a)
end
end