https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86863

            Bug ID: 86863
           Summary: [OOP][F2008] type-bound module procedure name not
                    recognized
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

Gfortran 8.2.0 fails to recognize the public type-bound procedure below. The
error message goes away when "module procedure" is replaced with "subroutine"
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
rouson@sourcery-VirtualBox:~/Desktop/Builds/frapcon4.1/src/reproducer$ gfortran
-c module-procedure.f90 
module-procedure.f90:24:22:

     call object%foobar
                      1
Error: ‘foobar’ at (1) should be a SUBROUTINE
rouson@sourcery-VirtualBox:~/Desktop/Builds/frapcon4.1/src/reproducer$ gfortran
--version
GNU Fortran (GCC) 8.2.0

Reply via email to