<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82390>82390</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] GENERIC INTERFACE: Incorrect diagnose when the proc-interface of a procedure pointer is a function that returns polymorphic pointer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code:
```
MODULE M
TYPE :: DT
INTEGER :: ID
END TYPE
CONTAINS
FUNCTION ModDt(Arg)
TYPE(DT) :: Arg
CLASS(DT), POINTER :: ModDt
END FUNCTION
END MODULE
PROGRAM PtrAssignGen
USE M
IMPLICIT NONE
INTERFACE ModDt
MODULE PROCEDURE ModDt
END INTERFACE
PROCEDURE(ModDt), POINTER :: ProcPtr
END
```
Flang currently issues an error as
```
./t.f:21:5: error: A PROCEDURE statement is only allowed in a generic interface block
MODULE PROCEDURE ModDt
^^^^^^^^^^^^^^^^^^^^^^^
```
The code seems conforming to me. If I remove the generic name from the interface block, it compiles successfully.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVEtvqzgU_jVmc9SIGGjDggXDo0JqSJSmi1kacwDPGDuyzb3Kvx9BHr1pr2Z1JSsO5-XvfP6OmbWiV4gJif4iUe6xyQ3aJDlTAmWWDai8RrfnJNPKihYNuAGh01Lqn0L1wHWLJEiJnxM_Jc_-dS2fANtd_vFWwPbqvloBjn_vC5jTghTy49Ve1cfitTjc7FX-GV_U-ZLztU62q49pVb9_tZcfdXasdjVsdZs7Qjep6QmNHwEQusmPhMa3A-eYz8pv6fv7LYLQDPa7Gd8d3aXwJXxGdzvxEcnsuXDwaN8fdq-HdAt7Z9KF_1dUN9_H-50wqLb7tyqrjlDv6i8lFjRlmhUPUODO-f6wy4r841DAN6z31G-gLhmEbq68_a7zvdF878y3Rq9_v2ngtpeSzXqZjEHl5BmEtRNaYArQGG2A2XvGY4kVoaVbdSRI6ZoEaTSDWFKWS_ulUeuYwxGVA2FBK3kGNssUWxAKGPSo0AgOQjk0HeMIjdT83-up_08biYo_sH43JJff44DLKIFFHC1wrTptxnnAnIYRV1B1UIHBUf_AZQJvzSg2InRGj4v1a2s0A-GA6_EkJFqwE-dobTdJeV7dL8Zrk6CNg5h5mKxf_E0Yxps48IaEd1EYrF_WURe0axquwyDkQRC27IWvXxr27ImE-jT0KfXXLzSM1itsujB-DjaboGEs7p5J6OPIhFxJ-WNcadN7y60nGxrEvidZg9IuDw-lzdQTSgnNCKXdLBUSpJ3RyqFqZ0eUeyaZyzw1U29J6Ethnf0s7ISTyyO26IxEObwWdXGosl_kPr8qimtjkDtoBeuVtgg_B1QLeyej-dMnhboDttiwnQzCSS-uWVsMuklxJ_ScxxwYdJNRFk5ankdtToPgt3BvMjIZnDvZeXxoSWjZCzdMzYrrkdByxn_dnk5G_4PcEVpeZoPQciHqvwAAAP__go6Z7w">