Dear Fortran Forum,
i got a problem with the ifort 18 Update 1 Compiler. It seems the way the alias attribute is handled in submodules has changed. I can't get my code to compile with the alias attribute. I need it, to keep downward compatibility of the dll. Is this new behavior intended or a bug?
Greetings
Wolf
module M_MOD
implicit none
type T_TYPE
contains
! procedure, nopass :: foo ! This works without ALIAS
procedure, nopass :: foo_renamed=>foo ! This works in none of my tests with 18.1
end type
interface
module subroutine foo()
! !DEC$ ATTRIBUTES ALIAS:"foo" :: foo
!DEC$ ATTRIBUTES DLLEXPORT :: foo
end subroutine
end interface
end module
submodule (M_MOD) S_MOD
implicit none
contains
module subroutine foo()
! IFORT 16 to 18.0 give "error #7286: This symbol has multiply declared DEC$ ATTRIBUTES ALIAS attribute. [FOO]"
! !DEC$ ATTRIBUTES ALIAS:"foo" :: foo ! Until 18.1 it worked without this line
!DEC$ ATTRIBUTES DLLEXPORT :: foo
end subroutine
end submodule
module M_USING_M_MOD
use M_MOD
implicit none
contains
subroutine bar()
type(T_TYPE) :: T_TYPE_INSTANCE
! IFORT 18.1 gives Link error: "error LNK2019: unresolved external symbol "M_MOD_mp_FOO" in function "M_USING_M_MOD_mp_BAR""
! call T_TYPE_INSTANCE%foo()
! IFORT 18.1 gives Link error: "error LNK2019: unresolved external symbol "M_MOD_mp_FOO_RENAMED" in function "M_USING_M_MOD_mp_BAR""
call T_TYPE_INSTANCE%foo_renamed()
end subroutine
end module