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

    <tr>
        <th>Summary</th>
        <td>
            [Flang][Assumed-rank] Missing diagnose on invalid assumed-rank actual argument
        </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:
```
subroutine sub(arg)
  character(*) :: arg(..)

  interface
   subroutine sub1(arg1) bind(c)
 character(1) :: arg1(2,4)
   end subroutine
  end interface

 call sub1(arg)                    ! Invalid
  call sub2(arg) ! Invalid
  contains
    subroutine sub2(arg2)
 character(*) :: arg2(10)
    end subroutine sub2
end subroutine
```

Both calls to `sub1` and `sub2` are invalid based on `c840` in the standard
[8.5.8.7]
```
C840 An assumed-rank variable name shall not appear in a designator or expression except as an actual argument that corresponds to a dummy argument that is assumed-rank, the argument of the function C_LOC or C_SIZEOF from the intrinsic module ISO_C_BINDING (18.2), the first dummy argument of an intrinsic inquiry function, or the selector of a SELECT RANK statement.
```

I don't see this can be a reasonable extension. Even it is, it seems not documented.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VMtu6zYQ_Rp6M4ggUQ_LCy0cOS6M3iZA01U3wUgcWWwp0iWpNPn7gvQjjmtcw7BBcubMOfNC5-ReEzWsfGTlZoGzH41tNqglqbYdSS86Iz6b1mgnBVnwI8FglDL_Sr2H3ghi-ZqlG5auWZWevvHo5s6a2UtN4OaO8RrtnvHV8RGgH9Fi78kyXjO-ZnwFASlfQ7Srk-RifHaR2pMdsKfzBXyPkR2DZAGrk1owXvdfEa8DZt_DBUfOeFtc8QPS4gr_fB1ub3ic8VGpKxYhwp0P4xns9DsqKS6ZODnyL8d7VkZ7lNpd-N2IP3nz-4L_l-Fgn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