To: J3 07-280r1 From: Michael Ingrassia Subject: Interp F03/0003 new proposed edit after failed ballot Date: 2007 November 14 This interp failed ballot N1617. The main objection was to the edit supplied in 05-180: >This cannot be diagnosed by the compiler in general, so it should not >be a constraint. This constraint would require a run-time check. So in this paper a different edit is supplied which is not a constraint. For those not keeping track (it took me some effort to recall) "Edit subsumed by interp F03/0004" means that option 1 of the interp in 04-323r1 passed: >Furthermore, the case with a disassociated pointer was not intended to be valid. This is part of our ANSWER so I have deleted it from the STATUS line. NUMBER: F03/0003 TITLE: Referencing deferred bindings KEYWORDS: Type-bound procedure, deferred binding DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: I thought that the intent was that it would be impossible to reference a deferred binding. However, it doesn't appear to me that this intent was achieved. Consider the following program (Sorry, but I don't have any compilers up to syntax-checking this). module defer type, abstract :: t contains procedure (sub), nopass, deferred :: deferred_proc end type t type, extends(t) :: t2 contains procedure :: deferred_proc => sub2 end type t2 contains subroutine sub write (*,*) 'Hello.' end subroutine sub subroutine sub2 write (*,*) 'Goodbye.' end subroutine sub2 end module defer program p use defer class(t), pointer :: x nullify(x) call x%deferred_proc end program p Is this a valid program? If not, what restriction of the standard does it violate? Note that x%deferred_proc does not require the value of x (4.5.7) and thus is not a reference to x (2.5.6). Therefore, [83:23-24] does not prohibit this. Nor is it clear that there is an intent to prohibit invocation of type-bound procedures for disassociated pointer objects; except in the case of deferred bindings, this seems well-defined and potentially useful. Because x is disassociated, its dynamic type is the same as its declared type, thus making the interpretation of x%nondeferred_proc reasonably clear. ANSWER: No, this was not intended to be a valid program. A type-bound procedure may not be invoked through an undefined pointer, a disassociated pointer, or an unallocated allocatable variable. An edit is supplied to clarify this situation. The same answer and edit also apply to F03/0004. EDITS: Insert after [04-007: 266: 24] ([07-007r3: 309: 11]): "The shall not be an undefined pointer, a disassociated pointer, or an unallocated allocatable variable." SUBMITTED BY: Richard Maine HISTORY: 04-322 m169 F03/0003 Submitted 04-322r1 m169 Passed by J3 meeting 04-418r1 m170 Subsumed by interp F03/0004 05-180 m172 Failed WG5 ballot N1617 - the edit is subsumed by F03/0004 07-280 m182 Revised 07-280r1 m182