From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10288 invoked by alias); 24 Oct 2010 22:28:17 -0000 Received: (qmail 10279 invoked by uid 22791); 24 Oct 2010 22:28:17 -0000 X-SWARE-Spam-Status: No, hits=-2.6 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; Sun, 24 Oct 2010 22:28:12 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46161] New: [OOP] Invalid: Passing non-polymorphic to allocatable polymorphic dummy X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: accepts-invalid 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: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 24 Oct 2010 22:28: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: 2010-10/txt/msg02048.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46161 Summary: [OOP] Invalid: Passing non-polymorphic to allocatable polymorphic dummy Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org Follow up to PR 45451 comment 14. The following is not detected: Passing a non-polymorphic actual argument ("type(foo), allocatable") to an allocatable polymorphic dummy ("class(foo), allocatable"). >>From Fortran 2008: "12.5.2.5 Allocatable and pointer dummy variables" "The actual argument shall be polymorphic if and only if the associated dummy argument is polymorphic, and either both the actual and dummy arguments shall be unlimited polymorphic, or the declared type of the actual argument shall be the same as the declared type of the dummy argument." Test case: attachment 21613 of PR 45451. Crayftn rejects the example with the following error message - gfortran prints no error: call doit(atx,acsr) ^ ftn-1872 crayftn: ERROR BUG23, File = long2.f90, Line = 304, Column = 17 Dummy argument "ACSR" is a polymorphic ALLOCATABLE. It requires a polymorphic ALLOCATABLE actual argument.