<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/155500>155500</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] Allocation should continue even if one of the allocate-object failed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend,
flang:runtime
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code:
```
class(*), allocatable :: a(:), a1
integer :: stat
allocate(real:: a1)
allocate(real :: a1, a(2:4), stat=stat)
print*, allocated(a)
end
```
`a1` is allocated multiple time, which will result an runtime error. However, the allocation of `a` should complete.
If I swap `a1` and `a` in the 2nd allocate statement, `a` is allocated successfully.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkUt2uszgMfJpwY50qmL9ywQVLVe15jAAGsjJJlYRW5-1XoZy2-j6pUlQ845mxrbzXsyFqRPGPKC6J2sJiXXNRRhN33UIm6e3403TWeD2Sg7AQTJbZPrSZYbAjiawVshWlPH6yHVh5L_AssBVYC-xAMdtBBdUzQcRnLagIyF6AVMhWm0AzuV-EDyoI2R5cEnh2pPiXnkbmX1X4KHe7BoqszQ-VvWN22Z-dfXPahN3myyONAs_qWSYz_hHt-VelopSg_ZsD68ZB35gg6JViu8eihwUemhkc-Y0DKANuM7EO5Jx1J_jXPuhOLsLjXI9u2hqwE0SdKOMXu_EIg11vTIFOTxffE3yDf6gbvPwoM75I2uwd0Ywvj3t6WikG7t7AzxB-GwbyftqYf06QjE021lmtEmrSqigxx7oqkqVRVA91JVPCrJgyHEolVZ6ec1lWNZ6HPtENSizkGUtM0zItTnVV5eNQIaVpnlJeiVzSqjSfmO_rybo50d5v1KRFUUiZsOqJ_X6TiBMrM4usnZw1IW4EUWD3UTiGGr8Xl8Q1sedXv81e5JK1D_6tEnTg_daf3OIC7Xvmr0GboM1GQHcyoCewhuI-PjZEX7b_j4YAk9JMY7I5bpYQbn4_6KvA66zDsvWnwa4Cr1H-eL5uzkamwOue2Au8HqHvDf4fAAD__5jRGbg">