From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4D989384AB5F; Mon, 22 Apr 2024 19:45:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D989384AB5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713815116; bh=Sz8acv1xCLmO8ewm5etSS1FHYz7Wk9+KI/C5GWEtmq0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SqcCfHWakml/ff9hLMr8Yhle1ozU3KDTt1Z3QGV3LLaXFBcMkI6Ylbuzmm4yRzISp Edo/zzoE+r3Z3etzcuQp9Ys/0JiTkin7VEnRo38uL7cepeyTivxI5gZ70jbhGxw/l0 Iaie8rWbVkPhoLf69QfHRUqC1d1PjNtqGsW7/OEQ= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/54389] [F2003/F2008 difference] PURE functions and pointer dummy arguments / DECL_PURE_P issue Date: Mon, 22 Apr 2024 19:45:11 +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: 4.8.0 X-Bugzilla-Keywords: diagnostic, rejects-valid, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: WAITING 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_status 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=3D54389 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |WAITING --- Comment #7 from anlauf at gcc dot gnu.org --- (In reply to Dominique d'Humieres from comment #6) > Compiling the test in comment 0 still gives the error >=20 > ptr =3D ptr + 1 > 1 > Error: Variable 'ptr' can not appear in a variable definition context > (assignment) at (1) in PURE procedure >=20 > at revision r229078 (trunk 6.0). That error looks correct to me. NAG rejects the code as well for any INTEN= T. To reconfirm: F2023 has "C15104 In a pure subprogram any designator with a base object that [...] is a pointer dummy argument of a pure function [...] shall not be used (1) in a variable definition context" There is no restriction on the INTENT of the pointer dummy. See also Note 4, 2nd paragraph for reasoning supporting this. Can we close this bug as fixed?=