[flang-commits] [PATCH] D147052: [flang] Fix checking of pointer passed to assumed-rank
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Tue Mar 28 07:56:09 PDT 2023
klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added subscribers: sunshaoce, jdoerfert.
Herald added a project: All.
klausler requested review of this revision.
Don't check ranks when a pointer actual argument is associated with
a pointer assumed-rank dummy argument.
https://reviews.llvm.org/D147052
Files:
flang/lib/Semantics/pointer-assignment.cpp
Index: flang/lib/Semantics/pointer-assignment.cpp
===================================================================
--- flang/lib/Semantics/pointer-assignment.cpp
+++ flang/lib/Semantics/pointer-assignment.cpp
@@ -315,7 +315,8 @@
"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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147052.509016.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230328/4040c112/attachment-0001.bin>
More information about the flang-commits
mailing list