(j3.2006) Need an interp for this?
Van Snyder
Van.Snyder
Fri Aug 19 00:07:17 EDT 2011
In this little module
module testr_m
type :: ty
integer, allocatable :: l2p(:)
end type ty
contains
subroutine testr(d)
type (ty), intent(inout) :: d ! Provides various options,
associate(l2p=>d%l2p)
allocate (d%l2p(4), stat=i)
....
the "allocate" statement ought to be disallowed.
There's nothing in 8.1.3 to prohibit it.
There's also nothing that says d%l2p has to be allocated when the
"associate" statement is executed.
We consciously modeled the associate construct on argument association,
but we have apparently left out several of the important restrictions on
arguments.
I had to explain to a colleague that "associate" is an executable
statement, and that an associate construct is not a template for macro
substitution. It's an explicitly inlined procedure.
Does this need an interp, or have I missed something somewhere that
covers this problem, and a few others that I would elaborate in an
interp paper?
More information about the J3
mailing list