https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78013
Bug ID: 78013
Summary: unexpected 'has no IMPLICIT type' error for a
type-bound function returning a procedure pointer
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: pault at gcc dot gnu.org
Target Milestone: ---
Reported at
https://groups.google.com/forum/#!topic/comp.lang.fortran/OIEdfZunBPk
module m
implicit none
abstract interface
function I_f() result( r )
real :: r
end function I_f
end interface
type, abstract :: a_t
private
procedure(I_f), nopass, pointer :: m_f => null()
contains
private
procedure, pass(this), public :: f => get_f
end type a_t
contains
function get_f( this ) result( f_ptr )
class(a_t), intent(in) :: this
procedure(I_f), pointer :: f_ptr
f_ptr => this%m_f
end function get_f
end module m
Upon compilation,
function get_f( this ) result( f_ptr )
1
Error: Symbol 'get_f' at (1) has no IMPLICIT type
ifort compiles it without problem.
I have a fix, which is just regtesting.
Paul