This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46321] New: [OOP] Polymorphic deallocation
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 5 Nov 2010 18:37:20 +0000
- Subject: [Bug fortran/46321] New: [OOP] Polymorphic deallocation
- Auto-submitted: auto-generated
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.