<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60228>60228</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] Compilation error of generic interface with specific procedure of the same name
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang-new : 16.0.0(77f2f34d696b77fe5bf05afbe7386966b6bcc8ba)
```
Generic interface 'add' with specific procedure of the same name results in a compilation-time error.
The following are the test program, flang-new, gfortran and ifort compilation result.
snggj112_.f90:
```fortran
module add_char
interface add
module procedure add
end interface add
contains
function add (x)
character, intent (in):: x
integer:: add
add = ichar (x) + ichar (x)
end function add
end module add_char
module add_int
interface add
module procedure add
end interface add
contains
function add (x)
integer, intent (in):: x
integer:: add
add = x + x
end function add
end module add_int
program main
use add_char
use add_int
implicit none
integer::ii_int
character, parameter:: a = 'A'
integer, parameter:: one = 1
write(1,*) add (a)
write(1,*) add (one)
rewind 1
read(1,*) ii_int; if (ii_int/=130) print *,'error-1'
read(1,*) ii_int; if (ii_int/=2) print *,'error-2'
end program main
```
```
$ flang-new -flang-experimental-exec snggj112_.f90
error: Semantic errors in snggj112_.f90
./snggj112_.f90:27:7: error: Cannot use-associate generic interface 'add' with specific procedure of the same name when another such generic is in scope
use add_int
^^^^^^^
./snggj112_.f90:2:13: Previous USE of 'addition'
interface add
^^^
$
```
```
$ gfortran snggj112_.f90
$
```
```
$ ifort snggj112_.f90
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vl2PqzYT_jXOzSgR2Hzlgovs7sl7-0qn7e2RMQN4BTayzUn67ysDCeRj20ZtV8CGYfzMM88MY7i1slaIOYnfSPyx4YNrtMl1o_S2-twUuvw9J0kwH8EHCQ6_obFSK9AVVC1X9VbhCQg7QJjsgl1AaJamFa1Y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