public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46321] New: [OOP] Polymorphic deallocation
@ 2010-11-05 18:37 janus at gcc dot gnu.org
  2010-11-05 21:02 ` [Bug fortran/46321] " burnus at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2010-11-05 18:37 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-08-08 14:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-05 18:37 [Bug fortran/46321] New: [OOP] Polymorphic deallocation janus at gcc dot gnu.org
2010-11-05 21:02 ` [Bug fortran/46321] " burnus at gcc dot gnu.org
2011-02-09 14:03 ` burnus at gcc dot gnu.org
2011-02-21 15:11 ` janus at gcc dot gnu.org
2011-11-26 14:33 ` burnus at gcc dot gnu.org
2012-01-29 14:37 ` burnus at gcc dot gnu.org
2012-05-07  9:34 ` sfilippone at uniroma2 dot it
2012-05-07  9:51 ` janus at gcc dot gnu.org
2013-07-22  7:31 ` janus at gcc dot gnu.org
2013-08-08 14:36 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).