From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20668 invoked by alias); 15 Feb 2012 21:00:47 -0000 Received: (qmail 20582 invoked by uid 22791); 15 Feb 2012 21:00:46 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Wed, 15 Feb 2012 20:59:59 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52227] [OOP] TARGET attribute mishandled in polymorphic types Date: Wed, 15 Feb 2012 21:20: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: missed-optimization, rejects-valid, wrong-code 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: 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-02/txt/msg01582.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52227 --- Comment #1 from Tobias Burnus 2012-02-15 20:59:06 UTC --- A related issue, for class(t), target, allocatable :: a(:) target :: a no error is printed - but it should! The problem seems to be that already for the first line, the class symbol is created - and the attr.target does not seem to get stored properly. The same problem occurs for ALLOCATABLE or POINTER - but only if the variable is a dummy, otherwise class_ok is false and the creation is deferred. Example: type t end type t contains subroutine foo(a,b) class(t) :: a, b allocatable :: a, b allocate(a,b) end subroutine end which fails with "ALLOCATABLE attribute conflicts with POINTER" while using "pointer" fails with "Duplicate POINTER attribute specified"