To: J3 J3/21-138 From: Van Snyder Subject: Interp F18/nnn Access Internal Procedure in Interface Body Reference: 18-007r1 Date: 2021-May-03 ---------------------------------------------------------------------- NUMBER: F18/nnn TITLE: Access Internal Procedure in Interface Body DEFECT TYPE: TBD STATUS: TBD EXAMPLE: Consider: program Test_Internal interface subroutine S1 ( S ) import S2 procedure ( S2 ) :: S end subroutine S1 end interface contains subroutine S2 end subroutine S2 end program Test_Internal C897 (R867) Each shall be the name of an entity in the host scoping unit. S2 satisfies this constraint. It is in the host scoping unit. C8101 Within an interface body, an entity that is accessed by host association shall be accessible by host or use association within the host scoping unit, or explicitly declared prior to the interface body. S2 violates this constraint. It is not, and cannot be, declared before the interface block. Some processors accept the program, and others do not. Interestingly, if a procedure declaration (with or without the POINTER attribute) that uses the internal subroutine to specify its interface appears before the interface block, e.g., procedure ( s2 ), pointer :: P the processor that rejects the program then accepts it. This is not a declaration of S2 that precedes the interface block. QUESTION: Unlike Pascal, Fortran does not have a FORWARD declaration. It is therefore impossible to declare an internal subprogram before an interface block in the host scoping unit. Was it intended that it be impossible to use an internal subprogram to specify the interface of a dummy procedure in an interface body? ANSWER 1: This was intended. ANSWER 2: This was an oversight. EDITS 1: No edits are necessary. EDITS 2: Revise constraint C8101 C8101 Within an interface body, an entity that is accessed by host association shall be accessible by host or use association within the host scoping unit, explicitly declared prior to the interface body, or an internal procedure of the host scoping unit. SUBMITTED BY: Van Snyder HISTORY: 21-138 m224 Submitted ----------------------------------------------------------------------