[Bug fortran/96320] gfortran 8-10 shape mismatch in assumed-length dummy argument character array

damian at sourceryinstitute dot org gcc-bugzilla@gcc.gnu.org
Thu Aug 20 17:17:33 GMT 2020


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

--- Comment #24 from Damian Rouson <damian at sourceryinstitute dot org> ---
This appears to be another example of an issue with a module procedure defined
in the same module as its interface body. In this case, the compiler doesn't
recognize a reference to the procedure:

± cat subroutine-call.f90 
module hole_interface
  type hole_t
  contains
    procedure set_user_defined
  end type

  interface
    module subroutine set_diameter (this)
      class(hole_t) this
    end subroutine

    module subroutine set_user_defined(this)
      class(hole_t) this
    end subroutine
  end interface

contains
  module procedure set_user_defined
  end procedure

  module procedure set_diameter
    call this%set_user_defined
  end procedure
end module

  use hole_interface
end

± gfortran subroutine-call.f90 
subroutine-call.f90:26:6:

   26 |   use hole_interface
      |      1
Error: ‘set_user_defined’ must be a module procedure or an external procedure
with an explicit interface at (1)

± gfortran --version
GNU Fortran (GCC) 11.0.0 20200804 (experimental)


More information about the Gcc-bugs mailing list