From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2CD5C3858005; Wed, 28 Oct 2020 08:51:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CD5C3858005 From: "mscfd at gmx dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97612] New: Structure constructor of type with nested allocatable array components fails to compile Date: Wed, 28 Oct 2020 08:51:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: mscfd at gmx dot net X-Bugzilla-Status: UNCONFIRMED 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Wed, 28 Oct 2020 08:51:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97612 Bug ID: 97612 Summary: Structure constructor of type with nested allocatable array components fails to compile Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mscfd at gmx dot net Target Milestone: --- The program below does not compile with error message: constructor_allocatable.F90:4:9: 4 | type :: s | 1 Error: The rank of the element in the structure constructor at (1) does not match that of the component (0/1) It is essential that x is an array, and that component u of type s has the allocatable attribute as well. However, component u does not need to be an array to trigger the error. program constructor_allocatable implicit none type :: s integer, dimension(:), allocatable :: u end type s type :: t type(s), dimension(:), allocatable :: x end type t type(t) :: a =3D t() end program constructor_allocatable=