J3/10-149r2 To: J3 Subject: Interpretation concerning the TARGET argument of ASSOCIATED From: Van Snyder Date: 2010 June 15 ------------------------------------------------------------------------ NUMBER: F08/0004 TITLE: Is TARGET argument of ASSOCIATED a pointer or nonpointer dummy KEYWORDS: TARGET argument of ASSOCIATED DEFECT TYPE: Erratum STATUS: Under consideration QUESTION: Is the following conforming, and if so what does it print? program TARGET_Arg integer, pointer :: Pointer integer, pointer :: Target => NULL() integer, target :: AnotherTarget pointer => anotherTarget print *, Associated(pointer,target) end program TARGET_Arg DISCUSSION: Subclause 13.7 stipulates that descriptions of arguments of intrinsic procedures apply to actual arguments. This leaves open the question whether the TARGET dummy argument of ASSOCIATED is a pointer or not. If not a pointer, being optional, it is considered by subclause 12.5.2.12 to be absent if the corresponding actual argument is disassociated. Thereby, the result value of ASSOCIATED (by Case(i) of the result value clause) is true. If the TARGET dummy argument is a pointer, the result value of ASSOCIATED (by Case (iv) of the result value clause) is false. ANSWER: It is intended that the program is conforming and prints F. Edits are provided to clarify this. NOTE: This subsumes interp F08/0005 (10-152). EDITS to 10-007: [330:8] Fix the description to read "Query pointer association status". Change the description of the interface to state explicitly that the TARGET dummy argument has the POINTER and INTENT(IN) attributes. A nonpointer actual argument is now permitted by 12.5.2.7p2 to correspond to an INTENT(IN) pointer dummy argument, whereupon the dummy argument becomes pointer associated with the actual argument. The result is that a disassociated TARGET actual argument cannot be considered to be absent. [13.7.16p3 330:14] Before "If TARGET" insert "The dummy argument TARGET has the POINTER and INTENT(IN) attributes." Replace "TARGET" by "the actual argument". [13.7.16p3 330:15+] Insert a note: "NOTE 13.8a This requires the actual argument for TARGET to have the POINTER or TARGET attribute. If the actual argument is not a pointer, the dummy argument TARGET is associated with the actual argument (12.5.2.7)." [13.7.16p5 Cases (iv) and (v) 330:23-29] Delete Cases (iv) and (v) because they will be subsumed be the revisions of cases (vi) and (vii). [13.7.16p5 Case (vi) 330:30] Replace "a scalar pointer" by "scalar". [13.7.16p5 Case (vii) 330:33] Delete "pointer". SUBMITTED BY: Van Snyder HISTORY: 10-149 m192 submitted 10-149r1 m192 revised ------------------------------------------------------------------------