J3/05-222 Date: 22 July 2005 To: J3 From: Rob James Subject: Default initialization of INTENT(OUT), assumed-size arrays NUMBER: F03/0060 TITLE: Default initialization of INTENT(OUT), assumed-size arrays KEYWORDS: default initialization, INTENT(OUT), assumed size, polymorphism DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider the following program: MODULE m TYPE base INTEGER I END TYPE TYPE, EXTENDS(base) :: child INTEGER :: j = 5 END TYPE CONTAINS SUBROUTINE sub(b) CLASS(base), INTENT(OUT) :: b(*) END SUBROUTINE END MODULE PROGRAM foo USE m TYPE(child) :: c(3) c%i = 12 c%j = 47 CALL sub(c) PRINT *, c%j END PROGRAM C544 prevents nonpolymorphic, INTENT(OUT), assumed-size arrays from having default initialization. The polymorphic case, however, is not checkable at compile time, so it cannot be a constraint. Was it intended that the dynamic type of an INTENT(OUT), assumed-size array could have default initialization? If so, what does the above program print? ANSWER: No, it was not intended that the dynamic type of such an array could have default initialization. An edit is provided to correct this oversight. EDITS: All edits refer to 04-007. [80:9-10] Create a new paragraph after the constraints in 5.1.2.5.4. This paragraph will consist of the text currently contained in C544. Delete constraint C544. Note: This edit interacts with that provided by interpretation F03/0045. SUBMITTED BY: Rob James HISTORY: 05-175 m172 Submitted 05-222 m173 Edit provided