- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FYI: This bug is still present in the latest compiler version (v12 Update 6).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's still there in v12 Update 8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for a future release. How important is it to have the fix in a 12.1 update?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page