You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Flang] Compile error when component-name declared in declaration-type-spec (class) with pointer attribute is used as an argument to entry statement
#132648
Open
ohno-fj opened this issue
Mar 23, 2025
· 1 comment
Version of flang : 21.0.0(3e6f618e86f5fbad2c2d5802416ec3d3366a2837)/AArch64
When component-name (cy1) declared in declaration-type-spec (class) with pointer attribute is used as an argument to entry statement, a compilation error occurs.
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
snggr249_22.f90:
module m3
type x1
integer::ix1
end type x1
type,extends(x1)::x2
end type x2
type,extends(x2)::x3
end type x3
class(x1),pointer,dimension(:)::cy1
containssubroutinedummy()
entry chk(c1)
class(x1),dimension(3)::c1
endsubroutine dummy
end module m3
subroutines1
use m3
type(x1),target::ty1(3)
ty1%ix1=[1,2,3]
cy1=>ty1
call chk(cy1)
endsubroutine s1program main
call s1
print*,'pass'end program main
$ flang snggr249_22.f90
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/PETA_V1020_PT3_FFE02/snggr249_22.f90":13:28): 'hlfir.declare' op for box address must not have a shape operand
error: verification of lowering to FIR failed
$
$ gfortran snggr249_22.f90; ./a.out
pass
$
$ ifx snggr249_22.f90; ./a.out
pass
$
The text was updated successfully, but these errors were encountered:
```
Version of flang : 21.0.0(3e6f618)/AArch64
```
When `component-name (cy1)` declared in `declaration-type-spec (class)` with `pointer attribute` is used as an argument to `entry statement`, a compilation error occurs.
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
snggr249_22.f90:
module m3
type x1
integer::ix1
end type x1
type,extends(x1)::x2
end type x2
type,extends(x2)::x3
end type x3
class(x1),pointer,dimension(:)::cy1
containssubroutinedummy()
entry chk(c1)
class(x1),dimension(3)::c1
endsubroutine dummy
end module m3
subroutines1
use m3
type(x1),target::ty1(3)
ty1%ix1=[1,2,3]
cy1=>ty1
call chk(cy1)
endsubroutine s1program main
call s1
print*,'pass'end program main
$ flang snggr249_22.f90
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/PETA_V1020_PT3_FFE02/snggr249_22.f90":13:28): 'hlfir.declare' op for box address must not have a shape operand
error: verification of lowering to FIR failed
$
When
component-name (cy1)
declared indeclaration-type-spec (class)
withpointer attribute
is used as an argument toentry statement
, a compilation error occurs.The following are the test program, Flang, Gfortran and ifx compilation/execution result.
snggr249_22.f90:
The text was updated successfully, but these errors were encountered: