From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id 766F23858D33 for ; Thu, 4 May 2023 14:44:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 766F23858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.17.1/8.17.1) with ESMTPS id 344Eib5o057411 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 4 May 2023 07:44:37 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.17.1/8.17.1/Submit) id 344EibwG057410; Thu, 4 May 2023 07:44:37 -0700 (PDT) (envelope-from sgk) Date: Thu, 4 May 2023 07:44:37 -0700 From: Steve Kargl To: Paul Richard Thomas Cc: fortran@gcc.gnu.org Subject: Re: finalization issue Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Paul, I'll need to go through F2018 again, but I thought I found a statement that a module procedure can be in a submodule. Here's the starting point 14.2.3 Submodules A submodule is a program unit that extends a module or another submodule. ... A submodule may provide implementations for separate module procedures (15.6.2.5), each of which is declared (15.4.3.2) within that submodule or one of its ancestors, and declarations and definitions of other entities that are accessible by host association in its descendants. 15.2.2.2 External, internal, and module procedures ... A module procedure is a procedure that is defined by a module subprogram, 15.6.2 Procedures defined by subprograms ... C1548 (R1526) If MODULE appears in the prefix of a module subprogram, it shall have been declared to be a separate module procedure in the containing program unit or an ancestor of that program unit. At this point, I get bogged down in chase 'module subprogram' through the standard. On Thu, May 04, 2023 at 09:09:30AM +0100, Paul Richard Thomas wrote: > Hi Steve, > > Nagfor responds to the test case with "Error: pr97122.f90, line 14: Type T > has final subroutines but is not defined in the specification part of a > module" > > F2018: > "C787(R753) A final-subroutine-name shall be the name of a module procedure > with exactly one dummy argument." > > Since, of necessity, the argument is declared to be of the derived type > with the final binding, the gfortran and nagfor errors are correct IMHO. > ifort compiles it without complaint. > > I have marked this as "waiting" pending a contrary interpretation. > > Cheers > > Paul > > On Wed, 3 May 2023 at 23:59, Steve Kargl via Fortran > wrote: > > > All, > > > > PR97122 shows an issue with finalization. > > It seems I attached a diff to the PR in 2020, > > which allows the code to compile. The diff > > applied to today's trunk still allows the > > code to compile but there is now at least > > 1 regression with finalize_8.f03. > > > > Even with my patch, I'm uncertain as to > > whether the finalizing subroutine is > > correctly hooked to the right namespace. > > > > -- > > steve > > > > > -- > "If you can't explain it simply, you don't understand it well enough" - > Albert Einstein -- Steve