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

    <tr>
        <th>Summary</th>
        <td>
            [flang] extra warning in declaring proc with the same name as private proc in module
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kkwli
      </td>
    </tr>
</table>

<pre>
    There is a warning when declaring a procedure with the same name as a private procedure declared in a module. Is this behavior expected?

`f1` is a private procedure but it seems to be accessible via use association.

```f90
module m
  private
  abstract interface
    real(4) function p(x, y)
    real(4) :: x, y
    end function
  end interface

  procedure(p) :: f1
end module

program main
  use m
  integer(4) :: x, y, z
! real(4) ::  f1
  z = f1(x, y)
end
```
Compile output:
```
$ flang-new -fsyntax-only d1.f90
./d1.f90:9:19: warning: The global subprogram 'f1' is not compatible with its local procedure declaration (incompatible procedure attributes: ImplicitInterface)
    procedure(p) :: f1
                    ^^
./d1.f90:16:7: Declaration of 'f1'
    z = f1(x, y)
        ^^
./d1.f90:9:19: Declaration of 'f1'
 procedure(p) :: f1
                    ^^
```

The behavior seems to occur after 0d588347000bd8245b8a1824758c6ed005ae5bce.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVM2O4ygQfhpyKXWEIf47-JDtbKS-zwsALtvsYLAAd7rn6VfYiRN1Z3YOG1kkRarqq5_PnwhB9xaxIflfJD_txBwH55ufPy9G76RrP5sfA3oEHUDARXirbQ-XAS20qIzwyRQweaewnT3CRccB4oAQxIhg0yHC4qHfRcQHzzUeW9AWBIyunQ3u4S1AHHQAiYN4184DfkyoIraEnwk9EXq8ngXtMlLQtbDv2eUcQUcIiGOA6EAiCKUwBC0NwrsWMIdUWnBKi6id3X_Jvj5dTdebtT4YVwtuiDdTyBC9UBG0jeg7obZ_ADwKQ1h1IKyGbrYqocFEWPVB2Ct8ElY_9yX8SPgRrl6bC9p2S3O7TXdfkO-FXkdCWDU9pO2y1SOFrs09xk3e9V6MMAq9gaSBbf0ntB7981rZK_y6ZmPZs542dIBfQPgp2d_mgbb9so3VfHXjpA2Cm-M0x5TxmRdhB-iMsP2LxQu8dOHTRvHx4qz5hDbbb4vdE3a-2vxYE37M0nGjevr5Y0DojZPCQJjlbTKElanoMhHQugjKjZOIC7uWd0DHAMYpYb5RfqEbEFZp-xB09xIxei3niCGhv42T0UrHt229j3z503bhyYfkf6fne_dZQfixTOGnh0Jdt_V6z_n7rf0R5T7j_0b5v6195cNypl1u0rKJg1Nq9iC6iB5om1cVP5SUUtlW7JDLSmQVO5R5pQpsKc0F5lLhftc2vK15LXbYZEVZViWjWbEbGoGsa4UsFFJ1QMTy0CJFVkvGSoWU73TDKOOUU57VnPNiX0rErhBt3mWKYV6TA8VRaLM35n3cO9_vdAgzNkWWlXRnhEQTFsFmbKE44cfOOxvTG8NYknHfpNAXOfeBHKjRIYZ7sqijWQR_Dc5PgB_R3-VdP4p7WsNvVP1RdVPQKiO72ZtmiHFK9CXsTNi513GY5V65kbBzKuP69TJ59w-qSNh5aTAQdl56_DcAAP__KVHyXg">