From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6FE69386F446; Sat, 15 Aug 2020 01:59:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FE69386F446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597456741; bh=OeDCS2g8LXeqvqHjk1X7/wR9HqITC/W7fv5Shcm92qE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IFL0XxzdP6gcc9s/zOy6cEk6eWYBYL36cs1/HYVXsIhVdL0o2kYIikiKEfVAnvLfP cL/4QrTtaCi9b6ba6YK4NorXZMJXNA1sXFY8Ut/IJbMdTDW9zvqKUVp4QUyQmTSdtB uAiV2pJV/G1/OPxOSZh2VgmkvknDcQnUJfDAvTPg= From: "damian at sourceryinstitute dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96320] gfortran 8-10 shape mismatch in assumed-length dummy argument character array Date: Sat, 15 Aug 2020 01:59:01 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: damian at sourceryinstitute dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 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: Sat, 15 Aug 2020 01:59:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96320 --- Comment #23 from Damian Rouson --- A related issue arises if the procedure in question is a pure function as demonstrated below. The code compiles cleanly if either 1. The result-spec is absent and the procedure is renamed new_foo in both t= he interface body and in the procedure definition, or 2. The interface body is repeated in the procedure definition instead the "module procedure" syntax. =C2=B1 cat pure-shape-mismatch.f90=20 module foobar implicit none type foo integer bar end type interface pure module function create() result(new_foo) implicit none type(foo) new_foo end function end interface contains module procedure create new_foo%bar =3D 1 end procedure end module=20 =C2=B1 gfortran -c pure-shape-mismatch.f90=20 pure-shape-mismatch.f90:17:4: 17 | new_foo%bar =3D 1 | 1 Error: Variable =E2=80=98new_foo=E2=80=99 cannot appear in a variable defin= ition context (assignment) at (1) in PURE procedure =C2=B1 gfortran --version GNU Fortran (GCC) 11.0.0 20200804 (experimental)=