[Bug fortran/46321] New: [OOP] Polymorphic deallocation
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 5 18:37:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46321
Summary: [OOP] Polymorphic deallocation
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: janus@gcc.gnu.org
Follow-up to PR 46174 (comment #2). Test case:
implicit none
type t
end type t
type, extends(t) :: t2
integer, allocatable :: all(:)
end type t2
class(t), allocatable :: a
allocate(t2 :: a)
select type(a)
type is (t2)
allocate(a%all(1000000))
end select
deallocate(a)
end
The deallocation occurs according to the declared type (not the dynamic type),
i.e. the allocatable components of t2 are not being deallocated.
Solution: Add a $free component to the vtab, which points to a deallocation
procedure.
More information about the Gcc-bugs
mailing list