To: J3 12-118r1 From: Malcolm Cohen/Robert Corbett Subject: Interp - finalization of INTENT(OUT) arguments Date: 2012 February 15 ---------------------------------------------------------------------- NUMBER: F08/0070 TITLE: Finalization of INTENT(OUT) arguments KEYWORDS: finalization INTENT(OUT) DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTIONS: The following questions assume the new text for paragraph 8 of Clause 4.5.6.3 provided in Corrigendum 1. The new text states When a procedure is invoked, an object that becomes argument associated with a nonpointer, nonallocatable INTENT(OUT) dummy argument of that procedure is finalized. The finalization caused by INTENT(OUT) is considered to occur within the invoked procedure; so for elemental procedures, an INTENT(OUT) argument will be finalized only if a scalar or elemental final subroutine is available, regardless of the rank of the actual argument. Question 1: Suppose an explicit-shape dummy array is argument associated with an array that has more elements than the dummy array. Are all of the elements of the effective argument of the dummy array finalized or are only those elements associated with elements of the dummy array finalized? Question 2: The last sentence of paragraph 17 of Clause 12.5.2.4 states If the dummy argument is not polymorphic and the type of the effective argument is an extension of the type of the dummy argument, only the part of the effective argument that is of the same type as the dummy argument becomes undefined. In such a case, is the entire effective argument finalized or is only the part of the effective argument that becomes undefined finalized? Question 3: Is the argument finalized before it becomes undefined? Question 4: If so, can its value be used in a specification expression? ANSWERS: A1. Only the part properly associated with the dummy argument was intended to be finalized; an edit is supplied to clarify this. A2. This is answered by interpretations F08/0068 and F08/0069; the quoted text has been deleted. A3. Yes. This is clarified by the same edit as for question 1. A4. No, because it becomes undefined on procedure invocation. EDITS: Delete, in the quoted text, "an object that becomes argument associated with" and after "is finalized" insert "before it becomes undefined" Making the whole paragraph read "When a procedure is invoked, a nonpointer, nonallocatable INTENT(OUT) dummy argument of that procedure is finalized before it becomes undefined. The finalization caused by INTENT(OUT) is considered to occur within the invoked procedure; so for elemental procedures, an INTENT(OUT) argument will be finalized only if a scalar or elemental final subroutine is available, regardless of the rank of the actual argument." SUBMITTED BY: Robert Corbett HISTORY: 12-118 m197 Submitted 12-118r1 m197 Draft answer ----------------------------------------------------------------------