https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102371

            Bug ID: 102371
           Summary: Error for type spec in FORALL statement
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

> cat test.f90
program main
implicit none
integer, parameter :: long = selected_int_kind(18)
integer(long), parameter :: very_large = 128_long
integer, allocatable, dimension(:,:) :: ary
allocate(ary(very_large, 2))
forall(integer(long) :: i=1:very_large, j=1:2)
ary(i, j) = i * j
end forall
print *, ary(5, 2)
deallocate(ary)
end program main

> ifort test.f90
> ./a.out
          10

> gfortran test.f90
test.f90:7:8:

    7 | forall(integer(long) :: i=1:very_large, j=1:2)
      |        1
Error: Syntax error in FORALL statement at (1)
test.f90:9:3:

    9 | end forall
      |   1
Error: Expecting END PROGRAM statement at (1)
test.f90:8:5:

    8 | ary(i, j) = i * j
      |     1
Error: Symbol 'i' at (1) has no IMPLICIT type
test.f90:8:8:

    8 | ary(i, j) = i * j
      |        1
Error: Symbol 'j' at (1) has no IMPLICIT type



I assume all the errors are a cascade from the first error, which is the issue
in this bug.  FORALL statements are supposed to allow a type spec.

Reply via email to