12-131 To: J3 From: Malcolm Cohen Subject: Polymorphic auto-targetting Date: 2012 February 15 ---------------------------------------------------------------------- NUMBER: F08/0073 TITLE: Polymorphic auto-targetting KEYWORDS: polymorphic, pointer, dummy DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider Program m013 Type t Real c End Type Type(t),Target :: x Call s(x) Print *,x%c Contains Subroutine s(p) Class(t),Pointer,Intent(In) :: p p%c = 3 End Subroutine End Program Is the invocation of S standard-conforming? According to 12.5.2.5p2, because dummy P is polymorphic, the actual argument is required to be polymorphic, even though the dummy argument is not associated with the actual argument. ANSWER: The invocation of S was intended to be standard-conforming; the polymorphism-matching requirement in 12.5.2.5 was intended to apply only when both the actual and dummy arguments were pointers (or allocatables). An edit is supplied to correct this mistake. EDITS to 10-007r1: [295:18] 12.5.2.5p2, change "The" to "Except in the case where the dummy argument is a pointer and the actual argument is not a pointer, the" SUBMITTED BY: Malcolm Cohen HISTORY: 12-131 m197 Submitted ----------------------------------------------------------------------