From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5850 invoked by alias); 16 Jun 2011 21:29:41 -0000 Received: (qmail 5842 invoked by uid 22791); 16 Jun 2011 21:29:41 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 21:29:27 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49213] [OOP] gfortran rejects structure constructor expression X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Thu, 16 Jun 2011 21:29:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01497.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49213 --- Comment #5 from janus at gcc dot gnu.org 2011-06-16 21:29:07 UTC --- (In reply to comment #4) > An intuitive way of viewing (and maybe even implementing I guess) the pro= cess > triggered by a structure constructor is as a sequence of assignment state= ments > for the components of the structure. But that's not how the (2008) stand= ard > describes what takes place, and so constraints that apply to assignments = (like > assigning to a polymorphic) don't apply in this context. I think you are wrong here. F08:7.2.1.3p13: "An intrinsic assignment where the variable is of derived type is performed= as if each component of the variable were assigned from the corresponding component of expr using pointer assignment (7.2.2) for each pointer compone= nt, de=EF=AC=81ned assignment for each nonpointer nonallocatable component of a= type that has a type-bound de=EF=AC=81ned assignment consistent with the component, i= ntrinsic assignment for each other nonpointer nonallocatable component, and intrinsic assignment for each allocated coarray component. For unallocated coarray components, the corresponding component of the variable shall be unallocate= d. For a noncoarray allocatable component the following sequence of operations= is applied." In essence this means that a derived type assignment *is* viewed as a seque= nce of component assignments. Therefore I think that the corresponding restrict= ions *do* apply.