From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30305 invoked by alias); 2 Dec 2010 04:35:54 -0000 Received: (qmail 30158 invoked by uid 22791); 2 Dec 2010 04:35:52 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Dec 2010 04:35:48 +0000 From: "damian at rouson dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/37336] Fortran 2003: Finish derived-type finalization X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: damian at rouson dot net X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: domob at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 02 Dec 2010 04:35:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg00135.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336 Damian Rouson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |damian at rouson dot net --- Comment #6 from Damian Rouson 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