From 3cf8259519c9fde6b8bb45cea4b8400bc5a7e386 Mon Sep 17 00:00:00 2001 From: David Truby Date: Tue, 28 Feb 2023 14:32:37 +0000 Subject: [PATCH] [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 --- flang/runtime/allocatable.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/flang/runtime/allocatable.cpp b/flang/runtime/allocatable.cpp index 6f066ea..b428ee6 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. -- 2.7.4