public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/59143] New: Problem with array dimension in polymorphic types
@ 2013-11-15  3:49 juergen.reuter at desy dot de
  2013-11-15  3:49 ` [Bug fortran/59143] " juergen.reuter at desy dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: juergen.reuter at desy dot de @ 2013-11-15  3:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59143

            Bug ID: 59143
           Summary: Problem with array dimension in polymorphic types
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de

The following code produces a warning, but is valid code:

gfortran  -c phs_single.f90
phs_single.f90:14.16:

    call func1 (phs%decay_p ())
                1
Warning: Actual argument contains too few elements for dummy argument 'p' (1/2)
at (1)

The code is:

module phs_single
  type :: phs_single_t
     real, dimension(:), allocatable :: p
   contains
     procedure :: evaluate
     procedure :: decay_p 
  end type phs_single_t

contains

  subroutine evaluate (phs)
    class(phs_single_t), intent(inout) :: phs
    call func1 (phs%decay_p ())
  end subroutine evaluate

  subroutine func1 (p)
    real, dimension(2), intent(in) :: p
    print *, p
  end subroutine func1

  function decay_p (phs) result (p)
    class(phs_single_t), intent(in) :: phs
    real, dimension(2) :: p
    p(1) = 1.
    p(2) = 5.
  end function decay_p

end module phs_single


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

end of thread, other threads:[~2013-11-25  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-15  3:49 [Bug fortran/59143] New: Problem with array dimension in polymorphic types juergen.reuter at desy dot de
2013-11-15  3:49 ` [Bug fortran/59143] " juergen.reuter at desy dot de
2013-11-15 20:38 ` [Bug fortran/59143] [OOP] Bogus warning with array-valued type-bound procedure janus at gcc dot gnu.org
2013-11-15 21:56 ` janus at gcc dot gnu.org
2013-11-16 10:23 ` janus at gcc dot gnu.org
2013-11-25  9:45 ` janus at gcc dot gnu.org
2013-11-25  9:51 ` janus 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).