[flang-commits] [flang] 50f1476 - [flang] Fix checking of pointer passed to assumed-rank

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Mar 28 11:57:01 PDT 2023


Author: Peter Klausler
Date: 2023-03-28T11:56:52-07:00
New Revision: 50f1476a9748c15b9c35391feccff08b75122620

URL: https://github.com/llvm/llvm-project/commit/50f1476a9748c15b9c35391feccff08b75122620
DIFF: https://github.com/llvm/llvm-project/commit/50f1476a9748c15b9c35391feccff08b75122620.diff

LOG: [flang] Fix checking of pointer passed to assumed-rank

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

Added: 
    

Modified: 
    flang/lib/Semantics/pointer-assignment.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/pointer-assignment.cpp b/flang/lib/Semantics/pointer-assignment.cpp
index d636cc0acca9..de6e78387b27 100644
--- a/flang/lib/Semantics/pointer-assignment.cpp
+++ b/flang/lib/Semantics/pointer-assignment.cpp
@@ -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) {


        


More information about the flang-commits mailing list