diff --git a/flang-rt/lib/runtime/assign.cpp b/flang-rt/lib/runtime/assign.cpp index 7cf4147a94a95..6aeb103208785 100644 --- a/flang-rt/lib/runtime/assign.cpp +++ b/flang-rt/lib/runtime/assign.cpp @@ -369,6 +369,9 @@ RT_API_ATTRS int AssignTicket::Begin(WorkQueue &workQueue) { return status; } } else if (!toDerived_->noDestructionNeeded()) { + // F'2023 9.7.3.2 p7: "When an intrinsic assignment statement (10.2.1.3) + // is executed, any noncoarray allocated allocatable subobject of the + // variable is deallocated before the assignment takes place." if (int status{ workQueue.BeginDestroy(to_, *toDerived_, /*finalize=*/false)}; status != StatOk && status != StatContinue) {