<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118240>118240</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] No error checking of using integer to initialize logical
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang : 20.0.0(590f451b60d434b26c634a07125fb05baf461fa0)/AArch64
```
Flang does not detect an error for using integer to initialize logical.
Flang and ifx do not detect errors, but Gfortran does.
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
i810_22.f:
```fortran
program main
logical b/4/
write(6,*) "b = ", b
end
```
```
$ flang i810_22.f; ./a.out
b = T
$
```
```
$ gfortran i810_22.f
i810_22.f:2:15:
2 | logical b/4/
| 1
Error: Incompatible types in DATA statement at (1); attempted conversion of INTEGER(4) to LOGICAL(4)
$
```
```
$ ifx i810_22.f; ./a.out
b = F
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVF1vnTgQ_TVzX0ZBZjDcywMP5IMoUtWVVtG-rgzY4C7XvrKHtN1fvzIhualWVWshYYx9jufMmVEx2slp3UB5C-X9Qa08-9D42fkb8-XQ-_F7A5XYH9H-pUO03qE3aBblJoSiRRKZyATQqayFkWXeV2KUheypGqpCKnHMqTS9KHtlZJUbJYBqoK5twzBXEkT7kQFE223Io9cRnWccNeuBUTnUIfiAxgdco3UTWsd60gHZo3WWrVrsvxoXP9lBLRniO5ZyI1rzDUf_EXGDi0B32K-Mj8YHDsptxNnrTZ5njcYvi_-a6FTQyLNG1pHxEvwU1Dmd3jjS5B3ijW_w54tdFFvvgDr9TQ9rmmPQcV14J7GnXPxNlBko2o9i7GAgWtzGzohnZa-Le7DYA3USqEs_vgbLGuhUAd0BtUA1AlGPUNynyRbwO4B24_8z8MMnyT3XHy56ixlQpzK_ckJ6xcbn1-2_xpvehLpC_qgDQdHm5S6IaJEQjnf485C3cd3yNnIQ7UPKcrLpk0vpUGz7RSN_v-iI1uF9-9xiZMX6rB2jYgQ65cmhxS0qZn2-sB5x8O7l6v2nz88Pjw9_Ap1kUpc9fvrj8emu_bSv_K4OySO_VLX7KZpoD2NTjHVRq4Nu8mNR5IKq6niYm0IeTWWKwRSqNmVdCCorIWXdl1QpWfUH25AgmZMgkZOkY1YN9Uj6VOV1VVCpjyCFPiu7ZMvycs58mA42xlU3eX4iKQ6L6vUSt75BtPkDitYE7zg5iih1k9Ckszf9OkWQYrGR4xWNLS9b33ktn_IeP_u9wodZD_-kivPmdyr9sIalmZkvMRmGOqBusjyvfTb4M1CXKPfXzSX4L3pgoG6LJgJ1e0AvDf0XAAD__-A5cvI">