(j3.2006) deallocating pointer function results

Robert Corbett robert.corbett
Wed Nov 4 18:17:34 EST 2015


On 11/04/15 06:04, Bill Long wrote:
> On Nov 4, 2015, at 12:31 AM, Malcolm Cohen<malcolm at nag-j.co.jp>  wrote:
>
>> I agree with that.  Moreover, the DEALLOCATE sets the pointer association
>> status of the dummy argument (and thus the actual) to disassociated, which
>> clearly cannot be done unless it is a "real" pointer variable.
>
> The fact that deallocation of a pointer causes it to become disassociated is clearly stated in 16.5.2.4(2).  While entirely expected, I don?t see a corresponding statement in that subclause that a pointer that is argument, host, or use associated with a pointer that is deallocated also becomes disassociated.  Should there be a statement like that in 16.5.2.4 (Events that cause pointers to become disassociated) ?   It then becomes relevant how the statement is worded.  If ?A pointer becomes disassociated if it is argument, use, or host associated with a pointer that becomes disassociated.?, then the case of the argument in the caller being a function reference is not a problem, since there is no ?pointer? in the caller that is argument associated.
>
Subclause 15.5.2.6, paragraph 2, states

       While two pointers are name associated, storage associated, or
       inheritance associated, if the association status of one pointer
       changes, the association status of the other changes accordingly.

Argument association is a form of name association.

Robert Corbett




More information about the J3 mailing list