Skip to content

[Flang] No error checking of using integer to initialize logical #118240

@ohno-fj

Description

@ohno-fj
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:

      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
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    flang:frontendquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions