Skip to content

[Flang] Confusing error message on BOZ constant to complex type assignment. #124201

@DanielCChen

Description

@DanielCChen

Consider the following code:

complex(4) :: z4
z4= (z'00000000', z'80000000')
end

Flang currently issues an error as

error: Semantic errors in t.f
./t.f:2:5: error: operands must be INTEGER, UNSIGNED, REAL, or BOZ
  z4= (z'00000000', z'80000000')
      ^^^^^^^^^^^^^^^^^^^^^^^^^^

This is confusing as the operands is indeed BOZ.
Also, Flang has the extension to allow BOZ literal to real or integer. This seems a reasonable case that should be allowed.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions