Discussion:
Bug 86863 - [OOP][F2008] type-bound module procedure name not recognized (edit)
Damian Rouson
2018-08-06 01:15:43 UTC
Permalink
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

Loading...