-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flang] Compilation abnormally terminates when derived type and interface statement with the same name is defined and used in two modules #121718
Comments
@llvm/issue-subscribers-flang-frontend Author: None (ohno-fj)
```
Version of flang : 20.0.0(c5492e3)/AArch64
```
The attached program has two modules with the same name (
In this case, a compilation terminates abnormally. The following actions for the program result in successful compilation:
The following are the test program, Flang, Gfortran and ifx compilation/execution result. snggz898_21.f90: module m1
type iand
integer:: x1=1
integer:: x2=2
end type iand
contains
subroutine foo
write(6,*) "iand(2,3) = ", iand(2,3)
end subroutine foo
end module m1
module m3
interface iand
integer function zzz(x1,x2) result(r)
character:: x1
integer:: x2
end function zzz
end interface iand
type iand
integer:: x1=1
character:: x2='2'
end type iand
end module m3
program main
use m1
use m3
call foo
print *,'pass'
end program main
integer function zzz(x1,x2) result(r)
character:: x1
integer:: x2
read(x1,*) k
r=k+x2
end function zzz
|
The error that I observe from this test is:
|
The attached program has two modules with the same name (
iand
) below.m1
) hastype-param-name-list
ofderived type
.m3
) hastype-param-name-list
inderived type
andgeneric-spec
ininterface
statement.In this case, a compilation terminates abnormally.
The program uses only the definition of module (
m1
).I suspect that the existence of unused module (
m3
) definitions should not affect the behavior.The following actions for the program result in successful compilation:
m3
) is deleted. or,type-param-name-list
inderived type
andgeneric-spec
ininterface
statement in module (m3
) to something other than iand.The following are the test program, Flang, Gfortran and ifx compilation/execution result.
snggz898_21.f90:
The text was updated successfully, but these errors were encountered: