public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Bug 86863 - [OOP][F2008] type-bound module procedure name not recognized (edit)
@ 2018-08-06  1:16 Damian Rouson
  0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2018-08-06  1:16 UTC (permalink / raw)
  To: gfortran; +Cc: Porter, Ian, Izaak Zaak Beekman

Gfortran 8.2.0 fails to recognize the public type-bound procedure "foobar"
below. The error message goes away when "module procedure" and "end
procedure" are replaced with "module subroutine" and "end subroutine,"
respectively, and the dummy arguments are declared in the definition of the
"set" subroutine.  With gfortran 7.3.0 and 6.4.0, the code below causes an
ICE.





$ cat module-procedure.f90

module foo

  implicit none

  type bar

  contains

    procedure, nopass :: foobar

  end type

contains

  subroutine foobar

  end subroutine

end module


module foobartoo

  implicit none

  interface

    module subroutine set(object)

      use foo

      implicit none

      type(bar) object

    end subroutine

  end interface

contains

  module procedure set

    use foo, only : bar

    call object%foobar

  end procedure

end module

$ gfortran -c module-procedure.f90

module-procedure.f90:24:22:


     call object%foobar

                      1

Error: ‘foobar’ at (1) should be a SUBROUTINE

$ gfortran --version

GNU Fortran (GCC) 8.2.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-06  1:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06  1:16 Bug 86863 - [OOP][F2008] type-bound module procedure name not recognized (edit) Damian Rouson

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).