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

    <tr>
        <th>Summary</th>
        <td>
            Missing diagnostic of the shape argument in c_f_pointer intrinsic
        </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>
    Diagnostic of the `shape` argument is missing.

```fortran
  use, intrinsic :: iso_c_binding
  integer :: csize
  integer, pointer :: iptr(:,:)
  type(c_ptr) :: cptr
  call c_f_pointer(cptr, iptr, shape=(/csize/))
end
```
`flang-new` compiles successfully

`gfortran` issues the following message:
```
Error: SHAPE argument at (1) to C_F_POINTER must have the same size as the RANK of FPTR
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUtuOmzAQ_Rp4sTYCm-sDD2kualV1G6X7jowx4K7ByDYbpV_fMYRklVayDGMfnzNzZipVX4u9oO2gjBUMqQbZjiMvCUxHRw5fRHU79XywSBjUC2PE0G68YO8F29ueBMtqlLaaDsspQpPhHt4hMVgtBgPcHtnCAhpVsrISQw1MKxhQvOV6xTAj_vCnO0c2KhfcYWK0cJy5CO_mPV8f2StkjzNWzpD8TuzCG4RRKRErm_LG6uAzencj3qHFBLJ3Ivi4ZIWPTmZV4kP9ZMM9bCQd2peBX5yLTPWjkNwgMzHGjWkmKa9PNrarg4AHoydAu2Y0Skp1AbNQDw9py10t_9M8aK20q_LX1-3p8GgctQgKCJ0NVqFdeSxPP7-9vh3OqJ-MRR394LOQoT1sUCOii_J5-_rdjcTx9HZ-UvR5ESZJjqMgjTK_Lkidk5z6VljJix_LmKD6n8GaDf00UsPnBjxmxZ-0LDprRzN3FRw_tsJ2U7UBHyGQ8mP9vIxa_ebMQrh4Bj9xHqap3xV1Q9I0JxnNqqBKqzwmrEnqGEcRIQlLuS9pxaUpvPiLh_HcL9BrtIJsoK8Ye_HeFwUOMA5DTHAYZ3G6oSROaEyzEEeE1QR7UcB7KuTGpbNRuvV1MWdWTa2BSymMNY9LCt60A-ezKvDTyXZKF-_vFyn8uYRizv8veSwbPQ">