From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24479 invoked by alias); 5 May 2011 13:11:30 -0000 Received: (qmail 24382 invoked by uid 22791); 5 May 2011 13:11:29 -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, 05 May 2011 13:11:15 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/48887] New: [OOP] SELECT TYPE: Associate name shall not be a pointer/allocatable 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: Thu, 05 May 2011 13:11: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-05/txt/msg00452.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48887 Summary: [OOP] SELECT TYPE: Associate name shall not be a pointer/allocatable Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org CC: janus@gcc.gnu.org, domob@gcc.gnu.org >>From F2008, 16.5.1.6 Construct association: "If the selector is allocatable, it shall be allocated; the associate name is associated with the data object and does not have the ALLOCATABLE attribute. "If the selector has the POINTER attribute, it shall be associated; the associate name is associated with the target of the pointer and does not have the POINTER attribute." However, gfortran accepts the following, ifort and NAG don't. It works if the associate name is explicitly given using "associate-name => selector"; however, it does not change the POINTER/ALLOCATABLE issue as: "The associate name of a SELECT TYPE construct is the associate-name if specified; otherwise it is the name that constitutes the selector." type t end type t class(t), allocatable :: alloc class(t), pointer :: ptr select type(alloc) type is (t) allocate(alloc) ! INVALID: "alloc" is not allocatable end select select type(ptr) type is (t) nullify(ptr) ! INVALID: "ptr" is not a pointer end select end For an longer example, see http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/88b65a2c9024e95f