To: J3 12-118 From: Robert Corbett Subject: Interp - finalization of INTENT(OUT) arguments Date: 2012 January 30 ---------------------------------------------------------------------- NUMBER: TITLE: Finalization of INTENT(OUT) arguments KEYWORDS: finalization INTENT(OUT) DEFECT TYPE: 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: When is the argument association established? According to paragraph 17 of Clause 12.5.2.4, "the actual argument becomes undefined at the time the association is established." If the actual argument becomes undefined before it is finalized, the finalization is likely to involve an undefined argument. If the actual argument does not become undefined until after it is finalized, then it might be possible to use its value in specification expressions. ANSWERS: EDITS: SUBMITTED BY: Robert Corbett HISTORY: 12-xxx m197 submitted