From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6434 invoked by alias); 23 Dec 2012 22:33:42 -0000 Received: (qmail 6374 invoked by uid 48); 23 Dec 2012 22:33:25 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46991] [OOP] polymorphic assumed-size actual arguments Date: Sun, 23 Dec 2012 22:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC 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" MIME-Version: 1.0 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: 2012-12/txt/msg02277.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46991 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #2 from Tobias Burnus 2012-12-23 22:33:24 UTC --- (In reply to comment #1) > Error: pr46991.f90, line 16: CLASS array A must be a pointer, allocatable or > assumed-shape I think that's a bug in NAG - at least, I cannot find anything in the standard which prohibits explicit-size or assumed-size polymorphic arrays. > The code modified this way still does not compile with current trunk: > A = [ (REC2(I, I+1), I = 1, 10) ] > 1 > Error: Variable must not be polymorphic in intrinsic assignment at (1) - check > that there is a matching specific subroutine for '=' operator See PR43366. That's a Fortran 2008 feature. Assignment to a polymorphic LHS variable is allowed, if and only if it is allocatable; it makes use of the realloc-on-assignment feature.