Skip to content

[Flang] fails to diagnose invalid write statement in forall construct #144181

Closed
@k-arrows

Description

@k-arrows

Reproducer:
https://godbolt.org/z/chnoPWx4e

integer :: i
forall (i = 1:1)
  print *, i
end forall
end

Gfortran and Ifx can diagnose the reproducer as follows:

Gfortran:

/app/example.f90:3:12:

    3 |   print *, i
      |            1
Error: Unexpected WRITE statement in FORALL block at (1)

Ifx:

/app/example.f90(3): error #7086: This statement in a FORALL construct is invalid.
  print *, i
--^
compilation aborted for /app/example.f90 (code 1)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions