(j3.2006) Did we intend to prohibit this?

Van Snyder Van.Snyder
Fri Mar 10 14:09:59 EST 2017


On Fri, 2017-03-10 at 16:13 +0900, Cohen Malcolm wrote:
> 
> >So how does it get deallocated?
> 
> "it" is not a variable, so does not get deallocated (in the Fortran
> language sense of "deallocated").
> 
> You know what the function result variable is, and it is not the value
> that is returned by the function, nor has it ever been.  The result
> variable is what gets deallocated.

So what does 9.7.3.2p4 mean?

        "If an executable construct references a function whose result
        is allocatable or has an allocatable subobject, and the function
        reference is executed, an allocatable result and any allocated
        allocatable subobject of the result is deallocated after
        execution of the innermost executable construct containing the
        reference."

If the result variable is in fact what gets deallocated, even though the
word "variable" does not appear in 9.7.3.2p4, then the result variable
of F(X) in

  call move_alloc ( f(x), v )

IS a variable, right?  So what's the problem with executing it?





More information about the J3 mailing list