http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60458
Bug ID: 60458
Summary: Error message on associate: deferred type parameter
and requires either the pointer or allocatable
attribute
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: antony at cosmologist dot info
module A
Type T
contains
procedure :: Test
procedure :: TestP
end type
contains
subroutine test(this)
class(T) this
associate(S=> this%TestP())
print *,S
end associate
end subroutine
function TestP(this)
class(T) this
character(LEN=:), allocatable :: TestP
TestP =''
end function TestP
end module
gives error
associate(S=> this%TestP())
1
Error: Entity 's' at (1) has a deferred type parameter and requires either the
pointer or allocatable attribute
At best the error message is unhelpful (defining S with pointer attribute does
not help), and the code seems valid (though it also happens to ICE ifort).