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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] %REF: Incorrect diagnostic.
        </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:
```
      interface
         subroutine sub(ctx)
            integer :: ctx
         end
      end interface

   integer, parameter :: ret = 5

   call sub(%ref(ret))

  end
  ```
  
  Flang currently issues an error as:
  ```
9:18: error: Assignment to constant 'ret' is not allowed
     call sub(%ref(ret))
 ^^^
```

XLF, gfortran and ifort all accept the above syntax.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU09voz4Q_TTmMmoEYxzgwCG_pEg_aU972qsxA_HKsSN76LbffmWattl2D4ss_IfH8_N7Y52SXTxRL9R_Qp0KvfI5xP6kvSV3PJ7JF2OYXvpj8MlOFIHPBHNwLvyyfgETJhLyIMqTKA9iX97aNoXtsZ4pztrQ_SIApHWMYWXrKQ8FtoafBXafUDeChSLkbeQBMuxPDPnpfoX89HnT9883LoFHuOqoL8QfxJEYhDyB-vSP0c7dJApUkWaBbSTOWt_kvmHvlHzx4q0fnM6-rTGSZ_cCNqWVEmgPFGOIoNO7n19YOiEPVZvFbtg8OGz5XcgzcAATfGLtGQQ2m8YGbAIfGHROjO6N-odzgVCPt_a3gF_fP74N2c9lDpGj9qCz_3mS9wRtDF15qxo9hieC9OJZP--KqZdTJztdUF811b6VddOp4ty3sxxrWc041qbtStWUCtE0ysy6UpXuCttjiXWpsKlaKSu1M5Xa71tVTY3qqKk7UZd00dbtnHu67EJcis3jvpN12xVOj-TSVu6I47oIRIFHgTjnYIQ8zDF4zkki5gsR-0zzMK5LEnXpbOL0QcyW3XZ1tlSFOoFA9f1xyMn8702IkQzDZPXiQ2JrdsUaXX9mvm4p4yBwWCyf13FnwkXgkJlv3cM1hp9kWODwWiMCh9cjPPX4OwAA__941xIV">