[Patch, Fortran] Deallocate CLASS(...),INTENT(OUT),allocatable arrays

Tobias Burnus burnus@net-b.de
Fri May 24 10:03:00 GMT 2013


On May 22, 2013 23:28Tobias Burnus wrote:
> A rather simple patch found while testing the draft finalization patch.
>
> For a "class(...), allocatable, intent(out)" dummy argument, the 
> actual argument has to be deallocated. That worked for scalar 
> polymorphic vars, but not for polymorphic arrays.

Actually, it turned out to be a bit more complicated: I forgot to test 
whether resetting the _vtab worked. Result (as to be expected): It 
didn't. I also found out that DEALLOCATE also didn't properly reset the 
_vtab. That's now fixed (and tested for) in the attached follow up patch.

(Recall that the standard mandates that an unallocated polymorphic 
variable has the declared type.)

> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intent-out-array.diff
Type: text/x-patch
Size: 7541 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130524/5844d800/attachment.bin>


More information about the Fortran mailing list