<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88677>88677</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Compilation error when INT is specified in generic-name of interface statement and in internal function
</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 : 19.0.0(4f19f15a601a5761b12c9c66d99d97dbc89ef90d)/AArch64
```
When INT is specified as `generic-name` in `interface` statement, `INT` intrinsic function in `internal function` (F1) results in a compilation error.
When line 7 of the program is changed as follows, the compilation terminates normally.
- Before the change
```
INTEGER :: A(INT(1_4))
```
- After the change
```
INTEGER :: A(1_4)
```
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
snggx159_3.f90:
```fortran
MODULE MOD
INTERFACE INT
MODULE PROCEDURE F1
END INTERFACE INT
CONTAINS
INTEGER PURE FUNCTION F1(I)
INTEGER :: A(INT(1_4))
INTEGER, PARAMETER :: KIND = SIZE(A)
INTEGER(KIND), INTENT(IN) :: I
F1 = I+ 1000
END FUNCTION F1
END MODULE MOD
program main
use mod
if (INT(1_4)/=1) print *,1
print *,'pass'
end program main
```
```
flang-new snggx159_3.f90
error: Semantic errors in snggx159_3.f90
./snggx159_3.f90:7:18: error: Procedure 'f1' is referenced before being sufficiently defined in a context where it must be so
INTEGER :: A(INT(1_4))
^^^^^^^^
$
```
```
$ gfortran snggx159_3.f90; ./a.out
pass
$
```
```
$ ifort -diag-disable=10448 snggx159_3.f90; ./a.out
pass
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVl9v4jgQ_zTmZQRyTMifBx5SICt0V1q19E66l5VxxolXiYNs59p--5OTUFjKre5WK0UBj2d-4_nNeCbcWlVqxCVZ3JHFesI7V7Vm2Va6ncpvk0NbvC9JRMeHrgnN_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