From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F0D303858D33; Thu, 4 May 2023 17:45:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0D303858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683222329; bh=N/a1OpVjux+Sf/RFCSOVkXZn0VLrKA992Cj32M41rdI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jYQlbNXcFDvvtQnqpgvrqS+9+QX8KUxWryVjYjKAWXK04t9lhIVrG6CM0TIQvBARM IbW6kcj4szCtT+pH3J0PJXUT1GXp9s5VhT6CoacitSaX/uB3O26TNWDiYGODDSi8UJ 2pNTMQOIt2vi8MJxCKslJqielwMqUlhnfd0uCF40= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97122] Spurious FINAL ... must be in the specification part of a MODULE Date: Thu, 04 May 2023 17:45:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97122 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #4 from kargl at gcc dot gnu.org --- (In reply to Paul Thomas from comment #3) > 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" >=20 > F2018: > "C787(R753) A final-subroutine-name shall be the name of a module procedu= re > with exactly one dummy argument." >=20 > Since, of necessity, the argument is declared to be of the derived type w= ith > the final binding, the gfortran and nagfor errors are correct IMHO. ifort > compiles it without complaint. >=20 > I have marked this as "waiting" pending a contrary interpretation. >=20 > Cheers >=20 > Paul Hi Paul,=20 I don't see how C787 applies. SUBROUTINE p(arg) TYPE(t), INTENT(INOUT) :: arg END SUBROUTINE p p() has exactly one argument. If I read F2018 correctly (which is almost always questionable), a module procedure can appear in a submodule.=