- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code when compiled with ifort Version 2021.10.0 Build 20230609_000000 causes:
The name of the module procedure conflicts with a name in the encompassing scoping unit.
Is this a bug?
module a
implicit none
type t
integer :: i(10)=1
contains
procedure :: f
end type
private :: f
contains
subroutine f(self)
class(t) :: self
integer :: c(sum(self%i(:)))
end subroutine
end module
module b
use a
implicit none
contains
subroutine f()
end subroutine
end module
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Zuodong_Y_, thank you for reporting this erroneous error message. I filed a bug on your behalf, CMPLRLLVM-56427.
@FortranFan, thanks for the workaround! No magical fix in an upcoming compiler.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Seems like a good and proper thing to me, that is why "use" had the only and renaming features.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think this should be valid as the subroutine "f" in module "a" is claimed as private.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's a compiler issue that Intel Support team can work with you. They may find this is already reported and there might be incident ticket on this already, and perhaps it's even fixed in a recent or forthcoming compiler update.
The problem has to do with how Intel packages the type-bound procedure binding. Say the following will likely be processed ok (note I have not tested this) by the Intel compiler though this is not needed.
module a
implicit none
type t
integer :: i(10)=1
contains
procedure :: f => t_f
end type
private :: t_f
contains
subroutine t_f(self)
class(t) :: self
integer :: c(sum(self%i(:)))
end subroutine
end module
module b
use a
implicit none
contains
subroutine f()
end subroutine
end module
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This workaround works. BTW, the issue also exist on Intel(R) 64, Version 2021.11.1 Build 20231117_000000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FortranFan is always on the ball, I had neglected to spot the "private" attribute in my earlier comments..... doh!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Zuodong_Y_, thank you for reporting this erroneous error message. I filed a bug on your behalf, CMPLRLLVM-56427.
@FortranFan, thanks for the workaround! No magical fix in an upcoming compiler.

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