From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 203CB3857806; Tue, 17 May 2022 23:21:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 203CB3857806 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/105243] ICE in next_char, at fortran/io.cc:160 Date: Tue, 17 May 2022 23:21:56 +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: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu 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: Tue, 17 May 2022 23:21:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105243 --- Comment #8 from Steve Kargl -= -- On Tue, May 17, 2022 at 07:56:18PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105243 >=20 > --- Comment #7 from anlauf at gcc dot gnu.org --- > (In reply to Steve Kargl from comment #6) > > > I quoted the F2018 standard constraint. > > >=20 > > > C708 An entity declared with the CLASS keyword shall be a dummy > > > argument or have the ALLOCATABLE or POINTER attribute. > > >=20 > > > class(t), parameter :: y > > >=20 > > > would seem to be missing all of the three listed attributes. >=20 > You're right here. >=20 > > I'll also add=20 > >=20 > > 7.3.2.3 CLASS type specifier > >=20 > > The CLASS type specifier is used to declare polymorphic entities. > > A polymorphic entity is a data entity that is able to be of differing > > dynamic types during program execution. > >=20 > > Does is make sense to given a named constant the polymorphic property? >=20 > Well, I could imagine named constants that do not have a type (e.g. when > using CLASS(*)), as well as named constants that refer to an extensible > type. The F2023 draft even has CLASSOF. Where will this finally lead... >=20 > I think I should ask the Intel people why their compiler accepts >=20 > program p > type t > integer :: i =3D 1 > end type t > type(t), parameter :: a =3D t() ! Legal > class(t), parameter :: b =3D t() ! Likely not > class(*), parameter :: c =3D t() ! ... > class(*), parameter :: d =3D 1 ! ... > end >=20 None of these are dummy arguments. None of these have the ALLOCATABLE attribute. None of these have the POINTER attribute. These all violate C708. For 4.2 Conformance,=20 2 A processor conforms to this document if: (3) it contains the capability to detect and report the use within a submitted program unit of a form or relationship that is not permitted by the numbered syntax rules or constraints, including the deleted features described in Annex B; Furthermore, the PARAMETER attribute conflicts with a dummy argument, ALLOCATABLE attribute, and POINTER attribute. At least, gfortran believes there is a conflict. subroutine foo0(x) class(*), parameter :: x end subroutine foo0 subroutine foo1() type t integer :: i =3D 1 end type t class(t), parameter, allocatable :: a end subroutine foo1 subroutine foo2() type t integer :: i =3D 1 end type t class(t), parameter, pointer :: a end subroutine foo2 % gfortran11 -c a.f90 a.f90:2:26: 2 | class(*), parameter :: x | 1 Error: PARAMETER attribute conflicts with DUMMY attribute at (1) a.f90:9:22: 9 | class(t), parameter, allocatable :: a | 1 Error: PARAMETER attribute conflicts with ALLOCATABLE attribute at (1) a.f90:16:31: 16 | class(t), parameter, pointer :: a | 1 Error: PARAMETER attribute conflicts with POINTER attribute at (1)=