From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C75F3858C5F; Fri, 3 Feb 2023 03:54:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C75F3858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675396460; bh=NjSfVgTZyo0hx4wGbFUqKy54ZiWcPZqPPJx9Nljd1/8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ch+WE0hNlj0teSDqTAmUxDhxoLZgmSrvpR/PblhP+FtBhIVPPMyZuYduN8mCA1X4H uUPTBAP/8/nHofUmdNTK0/kKHrXr0+oa1Oq2faIYCuYLkQDElg8nq+gy5o4mqwInn1 STrYzgZTdKVbNcG9OfB2lxHoOSB8lzr6SR8YjBdg= From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107721] Lost typespec with constant expressions using array constructors and parentheses Date: Fri, 03 Feb 2023 03:54:20 +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: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107721 --- Comment #4 from Jerry DeLisle --- Well folks, I like to document my thought process. >From the 2022 draft standard we have: R781 ac-value is expr or ac-implied-do R782 ac-implied-do is ( ac-value-list , ac-implied-do-control ) In our code within array.cc we are clearly matching for R782. However, we are not really trying to match expr of R781. Our basic problem here is we have the following: print *, [integer :: ([1.0])] ** 2 The ([1.0]) portion is clearly not an ac-implied-do, so what is it? So is it an expr? R1023 expr is [ expr defined-binary-op ] level-5-expr Looks to me that it is an expr. print *, ([1.0]) works quite well. We have, therefore an expr. In array.cc we have gfc_match_array_constructor. As far as I can tell we a= re matching the ac-implied-do, however we are not even trying to match expr. Let's see what we can do about it.=