From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13879 invoked by alias); 6 Sep 2013 06:00:53 -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 13827 invoked by uid 48); 6 Sep 2013 06:00:48 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/58331] New: [OOP] Bogus rank checking with explicit-/assumed-size arrays and CLASS Date: Fri, 06 Sep 2013 06:00: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.9.0 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-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc 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-09/txt/msg00326.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58331 Bug ID: 58331 Summary: [OOP] Bogus rank checking with explicit-/assumed-size arrays and CLASS Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: janus at gcc dot gnu.org The following code seems to be valid and to work, except for the bogus error message: Error: Rank mismatch in argument 'a' at (1) (rank-1 and rank-2) Reported by Simon Geard at https://groups.google.com/forum/#!topic/comp.lang.fortran/5oi9Sa4lnX4 module mymod implicit none contains subroutine mysub(a, n) integer, intent(in) :: n class(*), intent(in) :: a(n) select type(a) type is(integer) print *,'a is integer' class default print *,'a is unsupported type' end select end subroutine mysub end module mymod program upv use mymod implicit none integer :: a(3), b(2,2) a = [1, 2, 3] call mysub(a,3) b = reshape([1, 2, 3, 4], [2,2]) call mysub(b,4) end program upv