Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28991 Discussions

Implicit none in abstract interfaces

Juan_Senent
Beginner
495 Views
Hi,

I'm getting a strange error when I use implicit none in the definition of abstract interfaces. The following code

module test_class



!********************************************************************************
type, abstract, public :: type_test
!********************************************************************************
procedure(func_test), pass, pointer :: get_f=>null()

!********************************************************************************
end type type_test
!********************************************************************************

abstract interface



!********************************************************************************
function func_test(eq, x)
!********************************************************************************
import type_test
implicit none
class(type_test), intent(in) :: eq
real(8), intent(in) :: x
real(8) :: func_test

!********************************************************************************
end function func_test
!********************************************************************************

end interface


end module test_class


generates the error:

#6404: This name does not have a type, and must have an explicit type. [GET_F]
#7367: The data value NULL() can only be assigned to a Fortran POINTER.

but when I remove the 'implicit none' in 'func_test' the error disappears.

We have also seen that if there are more than one function (or subroutine) in the abstract interface declaration, as long as the first one does not have the 'implicit none' statement, the rest can have it or not and the program compiles fine.

Any help on this issue would be greatly appreciated

thanks

Juan


0 Kudos
5 Replies
Steven_L_Intel1
Employee
495 Views
I've seen something like this before, a compiler bug. I will look into it but won't be able to do so until next week.
0 Kudos
Jacob_Williams
New Contributor II
495 Views
FYI: This bug is still present in the latest compiler version (v12 Update 6).
0 Kudos
Jacob_Williams
New Contributor II
495 Views
It's still there in v12 Update 8.
0 Kudos
Steven_L_Intel1
Employee
495 Views
Sorry for the delay in following up on this. The problem is escalated as issue DPD200177491. I suggest removing the IMPLICIT NONE as a workaround for now.
0 Kudos
Steven_L_Intel1
Employee
495 Views
This has been fixed for a future release. How important is it to have the fix in a 12.1 update?
0 Kudos
Reply