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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Incorrect diagnostic of defined assignment
        </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 base
      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 )
 ^^^^^^
```

This seems incorrect. The compilers that I have tried (gfortran, ifort and XLF) all compiled it successfully. 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVE-P-yYQ_TT4MvpZ9hD_ycEHN1lLK_W4lXqrsBnbVBgiwLvKt6-Ik11vtoeqEiJk4DFv3jwjvFeTIWpY8RsrzolYw2xdcxZGkT6dZjJJb-W1OVnjlSQHYSYYrdb2Q5kJBiuJZW0cZXYfWbtYuWqCZdsBgHC9EPTC0_YXAAZrglDGx8DF2YHk6ojhCS7Ce4Z1z_AIjLeMt_DHX9-gADCRIaeGx4GtiIVMYFgzft6wZ8Zfdlgy8sbjk9SOwhbwa-_sGpShOwwY1iAiqx4YHr_I640kwzaG8QTKhC27XcOOufgBubF5wigTIfAA9Z-EIuUvUls4xjZ9f-rOsrbTIrZldY5M0FdQ3q_kQRgg56wD4Z8wKcMupCPjbc14y-O0HY2LM43KkNwJvBeJYbVu8mIV1Ry1GoKHDxXmWJxTxqth35xdB_9fD1nx8jz2FeQ8TsXGfNDCiaCsATt-o_qg8V_a_a8JnyR_m5UHT7R4UGawztEQUnibCQa7XJQm5yHMIsArzOKdIDhFMuaaRuuCE-ZmhrgGYST8-XsXaxdaP_ASVNR9GMj7cdX6mkIiGy6P_CgSavKKlwWWRVUncyNKpJJkUVZ5xuVY5oeK58c6P-Q5VpIOiWowwyLL8ywv8cjrtD7QONZFJSTled5zdshoEUqnWr8vqXVTcvNQkyMejlmiRU_a354LxH6dGCLDE0Mco_MYb0dno7Fl3CjOiWviPb_6dfLskGnlg_-6Oaigb0_PzbasOMPrQ0GQSkzG-qCG2ED5w4nJ6nQzh3Dx0UHYMewmFea1Twe7MOxikvvPr4uzf9MQGHbb98Cwu5fz3uA_AQAA___o54Cp">