From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C48313858408; Thu, 11 Nov 2021 21:01:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C48313858408 From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96255] [F2018] Implement optional type spec for index in DO CONCURRENT Date: Thu, 11 Nov 2021 21:01:33 +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: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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: Thu, 11 Nov 2021 21:01:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96255 --- Comment #9 from anlauf at gcc dot gnu.org --- (In reply to kargl from comment #8) > New patch. This adds a bool component to gfc_forall_iterator so > that an iterator with an index-name that shadows a variable from > outer scope can be marked. Shadowing only occurs when a type-spec > causes the kind type parameter to differ from the kind type=20 > parameter of the outer scope variable. F2018: 19.4 Statement and construct entities (6) The name of a variable that appears as an index-name in a DO CONCURRENT construct, FORALL statement, or FORALL construct has a scope of the statement or construct. ... So the index variable may inherit the kind of a declared variable if there is no typespec, but we always have to shadow a variable of that name from the outer scope. This is confirmed by Intel and NAG.=