<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/124621>124621</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Incorrect diagnostic on defined assignment when first argument is unlimited polymorphic
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            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 base
      integer(4) :: i = -999
      character(3) :: c = 'xxx'
      contains
         procedure, pass(b) :: U_base
         generic :: assignment(=) => U_base
   end type

   contains

   subroutine U_base ( a, b )
      class(*), intent(out) :: a
      class(base), intent(in)   :: b

   end subroutine

end module
```

Flang currently issues an error as:
```
./t.f:8:38: error: Defined assignment subroutine 'u_base' conflicts with intrinsic assignment
           generic :: assignment(=) => U_base
 ^^^^^^
./t.f:13:15: Declaration of 'u_base'
     subroutine U_base ( a, b )
 ^^^^^^

```

The code seems conforming to me, and all ifort, gfortran and XLF compiled it successfully.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVM2OtDYQfJrm0toR2LAMBw5k5hspUo6JlFtk7AYcGRvZ5tudt48M-8Pu5BBFQgxTdJnq6rJFCHq0RC1Uv0B1zcQaJ-fbq7CazOUykc16p-7txdmgFXmME-HgjHEv2o4onSLgHeQdPOdvV97NTq2GcE5w3iFivC-EvQi0_0VEbSON5IGdS2ANpjV4hxqBX_GpaZqPQjkJL2TcSvmhVG6lwOrX11dg9We9s1FoGz4ARFy8k6RWT8AuuIgQgJ37w1p__PVFGyKOZMlr-V6wuzSTjcDOwK879wr8xxcuWbW1-tH3QcwOhLX3bo3a0hsRgZ1RJF09Aju0bXaZwLoEs8vm2PZ9t8aDdvFA2fR842ibKPhO6j8EJcmfonY4YfsIv80V8u5mRBr76j3ZaO6oQ1gpoLBI3juPIjzG4QTsFk8D8O4MvOPptlenhysN2pI6WHw0CVi97gazOrk5GC1jwBcdp9Sc1zZoeRzPYYb_b4pQ_fh-HTsoeLpVu3JphBdRO4tu-CL1XcZ_Gfe_fvDR-N8n2nYbBqI5bF44P6c9GB3OW7KFVSiMQT04HxMwpgcv7Pbmz99uKN28aEMKdXJZSgphWI25nzLVctXwRmTUFjU_53mTN2U2tVT2w3POylpVNfUkB068rquSi4KdeSEz3bKcVXnBapYX56I8PTeFqnhFVMlSFSKHMqdZaHMy5ud8cn7Mtsy0BSufWZEZ0ZMJ2_HD2JDSBbwbvEvJVcBYOpR8m7hP_ToGKHOjQwyfq0UdzXZ8bdGE6oq_Wum8JxlRaTFaF6KW6Cyqx6i9TGRx0D5EFH5cN0wHXK3Rs46kcHHmPju_TFpmqzftFOOyRZzdgN1GHae1P0k3A7slRW8_T4t3f5OMwG77BgF2e-v3Z8v-CQAA___TeqBN">