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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Allocate object must be conformable with the `SOURCE=` in an ALLOCATE statement
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            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
```
    type base
        real      :: r1
    end type

    type (base), allocatable :: b1(:)
    type (base) :: b2 (10)

 b2 = base(10.0)

    allocate (b1(5), source=(/(b2(j),j=10,6)/))  !<-- this is illegal
end
```

The shape of the `SOURCE=` expr is 0 while the shape of the allocate object is `5`.
It is not conforming to the standard. All ifort, gfortran and XLF issues an error.
Is this an intentional extension for Flang?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU91upDwMfRpzYw0K4WeGCy74mCJ9UqVKu11pbwMYSJVJRknoz9uvEqbddtVRNCSxfXx87Ajn5KKJGij_g_KciM2vxjZnoSWprltJJ4OZ3prOaCcnsuhXwtkoZV6kXnA0EwFroWK3xVpERP92JRyEo9s5_CwJte8gbyFv0WY3K-kpRgSgT_HATxGC18A7FEqZUXgxKHoHGDLgp7Dn9fdxH448XGZsdwy-4SY_7xSDJf1kQ3xPtmOFLOWNhTObHQnyc8jM-2DmwE9Pu_kJ8nPI0lXx3Mf_GhF4Bnl3OKBfpcOwlKJFKGAt6ekf_YC1jyuhW8WV0MxRcKjYz4dfP7q7kLliSK9XG3AYvqxSUfT5EvBRgBmeaPTBFypWQsVSYO3_8UIbj6PRs7GX0Epvdhgv9CTslGKrFMrZWB8KX8LGCo1CT_j7vkfp3EYOhUay1tgI6_YChUapPWkvjRYK6dWTdtJonI3FXgm9QN4nU5NPdV6LhJrsWNTH_MgylqwNH-pCjHU1no5VlQuiEytExobhNE6jqOZENpzxklUZzwqW8zoteUbZPBXDfGRlnREUjC5CqlSp50tq7JJEsk1W5DVjiRIDKRcHnvN5p9PO1gTKE3AenoFtQuxh2BYHBVPSefcXzUuv4oPZg8tzkOqL3JfNeRzoXd44tC_Sr982UwZRsb2_f-jax7vQAE8X0j7ZrGpW768uzngPvF-kX7chHc0FeB_43D6HqzUhMfB-7wvw_lbtc8P_BAAA___opypS">