Skip to content

Commit

Permalink
[flang] Fix checking of pointer passed to assumed-rank
Browse files Browse the repository at this point in the history
Don't check ranks when a pointer actual argument is associated with
a pointer assumed-rank dummy argument.

Differential Revision: https://reviews.llvm.org/D147052
  • Loading branch information
klausler committed Mar 28, 2023
1 parent c57a58c commit 50f1476
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flang/lib/Semantics/pointer-assignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ bool PointerAssignmentChecker::Check(const evaluate::Designator<T> &d) {
"Target type %s is not compatible with pointer type %s"_err_en_US,
rhsType->type().AsFortran(), lhsType_->type().AsFortran()};

} else if (!isBoundsRemapping_) {
} else if (!isBoundsRemapping_ &&
!lhsType_->attrs().test(TypeAndShape::Attr::AssumedRank)) {
int lhsRank{evaluate::GetRank(lhsType_->shape())};
int rhsRank{evaluate::GetRank(rhsType->shape())};
if (lhsRank != rhsRank) {
Expand Down

0 comments on commit 50f1476

Please sign in to comment.