08-169 To: J3 From: Michael Ingrassia Subject: interp request: indistinguishable specifics for a generic interface with use association Date: 2008 April 29 NUMBER: F03/nnnn TITLE: indistinguishable specifics for a generic interface with use association KEYWORDS: GENERIC RESOLUTION USE ASSOCIATION DEFECT TYPE: Erratum Consider the following program MODULE M1 INTERFACE SUBR MODULE PROCEDURE SUBR1 END INTERFACE CONTAINS SUBROUTINE SUBR1 END SUBROUTINE END MODULE M2 INTERFACE SUBR MODULE PROCEDURE SUBR2 END INTERFACE CONTAINS SUBROUTINE SUBR2 END SUBROUTINE END PROGRAM MAIN USE M1 CALL S CONTAINS SUBROUTINE S USE M2 CALL SUBR END SUBROUTINE END Is this program standard conforming? ANSWER: Section 16.2.3 of the Fortran 2003 standard appears to forbid the presence of such conflicting interfaces. Section 12.4.4 clearly is written to allow for such conflicting interfaces, but there is nothing in that section that modifies the sense of Section 16.3.2. The question then becomes, do the rules of 16.3.2 apply only to explicitly declared procedures and to procedures made accessible through use association, or also to those accessible through host association? The committee concludes that the rules of 16.3.2 apply also to procedures accessible through host association. An edit is proposed to make this clear. Although some of the language in 12.4.4.1 could therefore be simplified, it is still useful for processors which extend the standard by relaxing some of the rules in 16.3.2 and there is no reason why it should not remain normative. A NOTE could be added to this section. EDITS: At [04-007.pdf:407:25-26] change "This subclause contains the rules that shall be satisfied by every pair of specific procedures that have the same generic identifier within a scoping unit" to "This subclause contains the rules that shall be satisfied within a scoping unit by every pair of specific procedures that have the same generic identifier, whether the specific procedures are intrinsic or are defined in the scoping unit itself, in the host, or in a module used by the scoping unit." At [04-007.pdf:278:5+] add NOTE: In a standard conforming processor which has not extended (i.e. relaxed) the rules laid out in Section 16.3.2 for pairs of specific procedures, the above rules can be effectively replaced by the somewhat simpler rule ----------------------------------------------------------- (*) Consider the set of specific interfaces of a generic interface that has that name and is in the unit in which the reference appears together with specific interfaces of a generic interface made accessible by a USE statement in the scoping unit. If the scoping unit has a host scoping unit and the name is established to be generic in that host scoping unit, then additionally include in the considered set the specific interfaces of the generic interface in the host scoping unit (regardless of whether the name is accessible in the scoping unit). If the scoping unit contains an INTRINSIC attribute specification for that name or a USE statement that makes that name accessible from a module in which the corresponding name is specified to have the INTRINSIC attribute, then additionally include in the considered set the interfaces of this intrinsic procedure. Then if the reference is consistent with a nonelemental reference to one of the procedures in the set, the reference is to that specific procedure. Failing that, if the reference is consistent with an elemental reference to one of the procedures in the set, the reference is to that specific procedure. In each case the rules in 16.2.3 ensure that at most one such specific procedure is specified. ------------------------------------------------------------ SUBMITTED BY: Robert Corbett and Michael Ingrassia HISTORY: 08-nnn m184 F03/nnnn Submitted --Michael I.