From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0DC293987C3F; Sun, 20 Sep 2020 00:22:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DC293987C3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600561320; bh=xpP6+DPvRjsWINbb9XYYHyxZBAT+IIFeUXn8qgUYBSw=; h=From:To:Subject:Date:From; b=l5rrKje06RjODWbjan4zTyWjocn0/s0pVQ8Cx0Ei0FTQKXysEtnGdVhrj6ehNd7xC D3kso/S/eJJogg6c/yi2Jv/FoOwTNYeunDIKzIe2S+/I/Jazj+hne3O/scu9d95jd4 fAWCwBy8KTj8fD7+B0Fvk6x4bRxWp2jupI2E4fxA= From: "ian_harvey at bigpond dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97122] New: Spurious FINAL ... must be in the specification part of a MODULE Date: Sun, 20 Sep 2020 00:21:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: ian_harvey at bigpond dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2020 00:22:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97122 Bug ID: 97122 Summary: Spurious FINAL ... must be in the specification part of a MODULE Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: ian_harvey at bigpond dot com Target Milestone: --- When compiling the following, recent master (and 10.2.1) issues an error=20 Error: Derived type declaration with FINAL at (1) must be in the specification part of a MODULE There is no such requirement in the language. MODULE m IMPLICIT NONE INTERFACE MODULE SUBROUTINE other IMPLICIT NONE END SUBROUTINE other END INTERFACE END MODULE m SUBMODULE (m) s IMPLICIT NONE TYPE :: t CONTAINS FINAL :: p END TYPE t CONTAINS SUBROUTINE p(arg) TYPE(t), INTENT(INOUT) :: arg END SUBROUTINE p MODULE SUBROUTINE other END SUBROUTINE other END SUBMODULE s ]$ gfortran -v -c 2020-09-20\ final.f90 Using built-in specs. COLLECT_GCC=3Dgfortran Target: x86_64-pc-linux-gnu Configured with: .././src/configure --prefix=3D/home/MEGMS2/ian/usr/gcc-11.= 0.0 --enable-languages=3Dc,c++,fortran,lto --enable-libgomp --enable-checking= =3Drelease --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20200919 (experimental) (GCC) COLLECT_GCC_OPTIONS=3D'-v' '-c' '-mtune=3Dgeneric' '-march=3Dx86-64' /home/MEGMS2/ian/usr/gcc-11.0.0/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/f951 2020-09-20 final.f90 -quiet -dumpbase 2020-09-20 final.f90 -dumpbase-ext .f= 90 -mtune=3Dgeneric -march=3Dx86-64 -version -fintrinsic-modules-path /home/MEGMS2/ian/usr/gcc-11.0.0/lib/gcc/x86_64-pc-linux-gnu/11.0.0/finclude -fpre-include=3D/usr/include/finclude/math-vector-fortran.h -o /tmp/ccPu3yx= p.s GNU Fortran (GCC) version 11.0.0 20200919 (experimental) (x86_64-pc-linux-g= nu) compiled by GNU C version 11.0.0 20200919 (experimental), GMP versi= on 6.1.2, MPFR version 4.0.2-p9, MPC version 1.1.0, isl version isl-0.16.1-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU Fortran2008 (GCC) version 11.0.0 20200919 (experimental) (x86_64-pc-linux-gnu) compiled by GNU C version 11.0.0 20200919 (experimental), GMP versi= on 6.1.2, MPFR version 4.0.2-p9, MPC version 1.1.0, isl version isl-0.16.1-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 2020-09-20 final.f90:14:10: 14 | FINAL :: p | 1 Error: Derived type declaration with FINAL at (1) must be in the specificat= ion part of a MODULE=