http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

Damian Rouson <damian at rouson dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |damian at rouson dot net

--- Comment #6 from Damian Rouson <damian at rouson dot net> 2010-12-02 
04:35:39 UTC ---
The test case below is a test of finalization of a concrete component of an
abstract type when a type that extends the abstract type goes out of scope. 
I'm working on determining how many times the final subroutine should be called
-- certainly at least once to finalize the new_child function result when it
goes out of scope after the assignment. 

module finalizable_component_module
  implicit none
  type finalizable_component
  contains
    final :: finalize
  end type
contains
  subroutine finalize(this)
    type(finalizable_component) :: this
    print *,'subroutine finalize called'
  end subroutine
end module

module abstract_parent_module
  use finalizable_component_module
  implicit none
  type ,abstract :: abstract_parent
    type(finalizable_component) :: foo
  end type
end module

module child_module
  use abstract_parent_module
  implicit none
  type, extends(abstract_parent) :: child 
  end type
contains
  type(child) function new_child()
  end function
end module

program main
  use child_module
  implicit none
  type(child) :: infant
  infant = new_child()
end

Reply via email to