<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115675>115675</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Compilation error when is_contiguous intrinsic procedure is used to define a variable
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang-new : 20.0.0(74b56c7eb807e2ba54bd7a2bcfda5d0bceff1c0c)/AArch64
```
When `is_contiguous` intrinsic procedure is used in initialization, a compilation error occurs.
The above program is `snggt825_2.f90`
For the following line
```
logical,parameter::a03=is_contiguous(array(:,:,:)(1:4))
```
The following changes result in successful compilation:
```
logical::a03
a03=is_contiguous(array(:,:,:)(1:4))
```
The above program is `snggt825_3.f90`
The following are the test program, Flang-new, Gfortran and ifx compilation/execution result.
snggt825_2.f90:
```fortran
subroutine s0
character(5) :: array(3,2,4)
logical,parameter::a03=is_contiguous(array(:,:,:)(1:4))
if (a03) print *,2003
end subroutine s0
program main
call s0
print *,'pass'
end program main
```
```
$ flang-new snggt825_2.f90
error: Semantic errors in snggt825_2.f90
./snggt825_2.f90:3:26: error: Must be a constant value
logical,parameter::a03=is_contiguous(array(:,:,:)(1:4))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$
```
```
$ gfortran snggt825_2.f90; ./a.out
pass
$
```
```
$ ifx snggt825_2.f90; ./a.out
pass
$
```
snggt825_3.f90:
```fortran
subroutine s0
character(5) :: array(3,2,4)
! logical,parameter::a03=is_contiguous(array(:,:,:)(1:4))
logical::a03
a03=is_contiguous(array(:,:,:)(1:4))
if (a03) print *,2003
end subroutine s0
program main
call s0
print *,'pass'
end program main
```
```
$ flang-new snggt825_3.f90
pass
$
```
```
$ gfortran snggt825_3.f90; ./a.out
pass
$
```
```
$ ifx snggt825_3.f90; ./a.out
pass
$
```
</pre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