From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 897 invoked by alias); 6 Dec 2013 18:53:16 -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 Received: (qmail 879 invoked by uid 48); 6 Dec 2013 18:53:13 -0000 From: "antony at cosmologist dot info" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) Date: Fri, 06 Dec 2013 18:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: blocker X-Bugzilla-Who: antony at cosmologist dot info X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg00555.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414 Bug ID: 59414 Summary: Class array pointers: compile error on valid code (Different ranks in pointer assignment) Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: antony at cosmologist dot info Created attachment 31394 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31394&action=edit OOP module implementing lists of arrays of objects Compiler errors like ObjectLists.f90:597.4: Item => L%ArrayItem(i) 1 Error: Different ranks in pointer assignment at (1) Code is a class array pointer to a function that returns a class array pointer: function ArrayItem(L, i) result(P) Class(TObjectList) :: L integer, intent(in) :: i Class(*), pointer :: P(:) select type (Point=> L%Items(i)%P) class is (object_array_pointer) P => Point%P class default stop 'TObjectList: item is not array item' end select end function ArrayItem ... class(*), pointer :: Item(:) Item => L%ArrayItem(i) Code is valid and works with the Intel compiler. Complete generic list module attached (from the widely-used but currently not gfortran-compiling CosmoMC parameter estimation package).