J3/05-210r2 To: J3 Subject: Pointer function references as actual arguments From: Malcolm Cohen Date: 2005/08/10 References: WG5/N1626-UK-007 1. Basic Functionality Allow references to functions returning an associated pointer to appear as actual arguments associated with INTENT(OUT) dummies. This is parallel to the way pointer variables are treated. 2. Detailed specification When a pointer is passed to a nonpointer dummy argument, the dummy argument becomes associated to the target of the pointer, not the actual argument itself. Some of the restrictions on dummy arguments, in particular those on definability, should apply to this associated entity rather than the actual argument. The terminology and its use in chapter 12 should also be clarified so that this distinction can be more easily understood. 3. Syntax There is no new syntax. 4. Edits to 04-007 [81:35] In the fourth paragraph after C546 -- the one that begins "If no INTENT..." -- replace "associated actual argument" by "argument associated entity". [268:1-15] In the first paragraph of 12.4.1, use "correspond" in the appropriate form instead of "associate". In detail: Replace "is associated with" by "corresponds to" at [268:5], [268:7-8], [268:9], and [268:10]. Replace "be associated with" by "correspond to" at [268:13], [268:14], and [268:15]. Then add a new paragraph: "Except in references to intrinsic inquiry functions, if the dummy argument is not a pointer and the corresponding actual argument is a pointer, the actual argument shall be pointer associated with a target and the dummy argument becomes argument associated with that target. Otherwise the dummy argument becomes argument associated with the corresponding actual argument. [269:20-22] Delete the paragraph that begins "Except in references to intrinsic inquiry functions...." [270:38-39] In the paragraph that begins "If a nonpointer dummy argument has INTENT(OUT)..." replace "actual argument" by "argument associated entity" and replace "corresponding actual argument by "argument associated entity". [418:16-17] Replace the first sentence of the second paragraph of 16.4.5 Establishing associations -- the one that begins "For argument association..." -- by "For argument association, if the dummy argument is not a pointer and the corresponding actual argument is a pointer, the pre-existing entity is the target of that pointer. Otherwise the pre-existing entity is the corresponding actual argument. In either case, the associating entity is the dummy argument."