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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Structure constructor issue with parent component
        </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:
```
program main

    type A
        class(*), pointer :: u1(:)
    end type

    type, extends(A) :: B
    end type

 type(B), target :: b1
    type(A), pointer :: ptr(:)

 allocate(ptr(2))

    b1 = B(ptr)     !! FAIL
!    b1 = B(u1=ptr)  !! WORK

end program
```

When the `u1` component is of unlimited-poly, Flang seems take `ptr` as the parent component in the structure constructor because it is of type `A`. 
However, the standard seems requires component keyword for the parent component.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0k0-P4ygQxT8NvpQ64k-w44MPTqJoV7vSSjuHPhO7YjONwQO4M_n2I4ij_jM9USQLVb3fexSgQtCDRWyI3BN5LNQSR-ebo7IazeEwoi3Orr81B2eD7tFDHBEuzhh31XaAzvVIREtoS0q6_mk7ezd4NcGktE0l2gIAxNuM8FikX2dUCITvCG8Jrwk_wOy0jeghIUULC0tVkat3Gdo-cz5SkxR_RrR9wqX2B2H_te4u2u1X26j8gPGhObMP6N0fws3Rv0-XNMoY16mYRPcqz9L6Le2ZARFH2D866jwIwhnhDE7t3_-mVs4-tS6MiOOjf21-_u__f-7ctLd14p_OgdD2eUSbz4yUdGGkpNC5aXYWbQQdwF1gsUZPOmL_NDtzSxs9GWUHCIhTgKhesja5lxRUyLBZ-QR4h7qbhOiXLi4eoXP2vnAeztipJSDoh2W-CaTMYTdAaPuXu-Ir-nwWGaNsr3y_ZvD4Y9Eewzu_F7xdne_h4vyXgTaEtkXfiL4WtSqwYZWsJZOCsmJskKqKl30tVSVFSbe9QMp5xTqkQtadKHTDKZeMUsF2TFK6qbpLV1dCSlmVW9ZLsqU4KW02xrxOG-eHQoewYMNKtttVhVFnNCE_Kc4vaZpEtBfvbLqihPP00HyTtE_nZQhkS40OMbzRoo4mP8m7WB7h25eTza5w1XH8bQLF4k0zxjiHfEVPhJ8GHcflvOncRPgpea2fp9m779hFwk8ZGAg_rTt5bfivAAAA__9960AS">