12-169 To: J3 From: Malcolm Cohen Subject: Interp Generic spec Date: 2012 June 29 ---------------------------------------------------------------------- NUMBER: F08/0082 TITLE: Generic identifier and dtv arguments KEYWORDS: Generic, Defined i/o DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider Module m198_010 Interface g Module Procedure mp1, mp2 End Interface Type t Real c End Type Interface Write(Formatted) Module Procedure fwrite End Interface Contains Subroutine mp1(a,dtv) Integer,Intent(Out) :: a Integer,Intent(In) :: dtv a = dtv End Subroutine Subroutine mp2(b,dtv) Real,Intent(Out) :: b Integer,Intent(In) :: dtv End Subroutine Subroutine fwrite(dtv,unit,iotype,v_list,iostat,iomsg) Class(t),Intent(In) :: dtv Integer,Intent(In) :: unit,v_list(:) Character(*),Intent(In) :: iotype Integer,Intent(Out) :: iostat Character(*),Intent(InOut) :: iomsg If (iotype/='NAMELIST' .And. iotype/='LISTDIRECTED') & Stop 'NYI' Select Type (dtv) Class Is (t) Write(unit,*,Iostat=iostat,Iomsg=iomsg) 'T',dtv%c Class Is (t2) Write(unit,*,Iostat=iostat,Iomsg=iomsg) 'T2',dtv%c,dtv%ok End Select End Subroutine End Module After corrigendum 1, constraint C1214 reads C1214 Within the scope of a , if two procedures have the same generic identifier, their \cf{dtv} arguments (9.6.4.8.3) shall be distinguishable. The scope of the READ(FORMATTED) generic-spec is the entire module M198_010, and within that module, the two procedures MP1 and MP2 have the same identifier (G), but their DTV arguments are not distinguishable. This clearly violates the new C1214, but the module conforms to the Fortran 2003 standard. Is this module intended to be standard-conforming? ANSWER: Yes, this was intended to be standard-conforming. An edit is supplied to correct the typographical error in Corrigendum 1. EDITS: [286:12-13] In the new version of C1214 from Corrigendum 1, change "the same" to "that". SUBMITTED BY: Malcolm Cohen HISTORY: 12-nnn m198 F03/0082 submitted ----------------------------------------------------------------------