[flang-commits] [flang] 3cf8259 - [flang] Allow `to` argument of move_alloc to be class(*)

David Truby via flang-commits flang-commits at lists.llvm.org
Tue Feb 28 06:33:19 PST 2023


Author: David Truby
Date: 2023-02-28T14:32:59Z
New Revision: 3cf8259519c9fde6b8bb45cea4b8400bc5a7e386

URL: https://github.com/llvm/llvm-project/commit/3cf8259519c9fde6b8bb45cea4b8400bc5a7e386
DIFF: https://github.com/llvm/llvm-project/commit/3cf8259519c9fde6b8bb45cea4b8400bc5a7e386.diff

LOG: [flang] Allow `to` argument of move_alloc to be class(*)

This patch expands the runtime check in move_alloc to allow the
destination to be unlimited polymorphic.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D143571

Added: 
    

Modified: 
    flang/runtime/allocatable.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/allocatable.cpp b/flang/runtime/allocatable.cpp
index 6f066ead7d99..b428ee6fcbd7 100644
--- a/flang/runtime/allocatable.cpp
+++ b/flang/runtime/allocatable.cpp
@@ -44,9 +44,6 @@ void RTNAME(AllocatableInitDerived)(Descriptor &descriptor,
 std::int32_t RTNAME(MoveAlloc)(Descriptor &to, Descriptor &from, bool hasStat,
     const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
   Terminator terminator{sourceFile, sourceLine};
-  // Should be handled by semantic analysis
-  RUNTIME_CHECK(terminator, to.type() == from.type());
-  RUNTIME_CHECK(terminator, to.IsAllocatable() && from.IsAllocatable());
 
   // If to and from are the same allocatable they must not be allocated
   // and nothing should be done.


        


More information about the flang-commits mailing list