J3/15-211 To: J3 From: Malcolm Cohen Subject: Interp on INTENT(OUT) pure polymorphic components Date: 2015 August 06 ---------------------------------------------------------------------- NUMBER: F08/0143 TITLE: May a pure procedure have an INTENT(OUT) polymorphic component? KEYWORDS: PURE, INTENT(OUT), polymorphic DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider: Type t Class(*),Allocatable :: c End Type ... Pure Subroutine zap(x) Type(t),Intent(Out) x x%c = 'I wonder if that invoked an impure procedure?' End Subroutine Is this program standard-conforming? ANSWER: No, this is not standard-conforming. Corrigendum 1 of Fortran 2008 added the constraint "C1284a A statement that might result in the deallocation of a polymorphic entity is not permitted in a pure procedure." The type declaration statement with INTENT(OUT) causes the deallocation of the polymorphic component X%C, and is therefore not allowed. However, this is difficult to understand, so a clarifying edit is provided. EDITS: In the constraint added by Corrigendum 1, "C1278a An INTENT (OUT) dummy argument of a pure procedure shall not be polymorphic." after the word "polymorphic" insert "or have a polymorphic allocatable ultimate component". SUBMITTED BY: Malcolm Cohen HISTORY: 15-nnn m207 F08/0143 Submitted ----------------------------------------------------------------------