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

name conflicting compilation error

Zuodong_Y_
Novice
532 Views

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

 

 

1 Solution
Barbara_P_Intel
Moderator
376 Views

@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.

 

View solution in original post

0 Kudos
6 Replies
andrew_4619
Honored Contributor II
496 Views

Seems like a good and proper thing to me, that is why "use" had the only and renaming features.

0 Kudos
Zuodong_Y_
Novice
489 Views

I think this should be valid as the subroutine "f" in module "a" is claimed as private.

0 Kudos
FortranFan
Honored Contributor II
480 Views

@Zuodong_Y_ ,

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

 

Zuodong_Y_
Novice
411 Views

This workaround works. BTW, the issue also exist on Intel(R) 64, Version 2021.11.1 Build 20231117_000000

0 Kudos
andrew_4619
Honored Contributor II
403 Views

FortranFan is always on the ball, I had neglected to spot the "private" attribute in my earlier comments..... doh!

0 Kudos
Barbara_P_Intel
Moderator
377 Views

@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.

 

0 Kudos
Reply