public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58331] New: [OOP] Bogus rank checking with explicit-/assumed-size arrays and CLASS
@ 2013-09-06  6:00 burnus at gcc dot gnu.org
  2013-09-06 21:35 ` [Bug fortran/58331] " burnus at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-09-06  6:00 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-03-15 20:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-06  6:00 [Bug fortran/58331] New: [OOP] Bogus rank checking with explicit-/assumed-size arrays and CLASS burnus at gcc dot gnu.org
2013-09-06 21:35 ` [Bug fortran/58331] " burnus at gcc dot gnu.org
2013-09-08 16:46 ` burnus at gcc dot gnu.org
2014-03-22 15:02 ` dominiq at lps dot ens.fr
2023-03-06 21:43 ` anlauf at gcc dot gnu.org
2023-03-06 22:13 ` anlauf at gcc dot gnu.org
2023-03-07  9:14 ` burnus at gcc dot gnu.org
2023-03-09 19:44 ` anlauf at gcc dot gnu.org
2023-03-14 19:39 ` anlauf at gcc dot gnu.org
2023-03-15  8:58 ` burnus at gcc dot gnu.org
2023-03-15 19:22 ` cvs-commit at gcc dot gnu.org
2023-03-15 20:03 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).