The following is supposed to be valid Fortran 2008 code, IIUC:
forall (integer(kind=4) :: i = 1:10)
However, gfortran currently throws a "Syntax error in FORALL statement".
My version of the Fortran 2008 standard has:
R752 forall-header is ( [ type-spec :: ] forall-triplet-spec-list [, scalar-mask-expr ] )
C735 (R752) type-spec shall specify type integer.
Actually it seems that not only specifying a kind is new, but specifying the type at all (which is restricted to integer anyway).
gfortran also rejects this simpler version (which only specifies the type, but no explicit kind):
forall (integer :: i = 1:10)
See array.c(gfc_match_array_constructor) for code to match
a type spec in an array constructor. Looks like a copy and
paste with an additional check for INTEGER to
match.c:match_forall_header mamy fix this bug.
Note: These things (R752 and C735) also apply to DO CONCURRENT (PR 44646).
It appears that the link to this PR shall replace the link to PR4646 at the Fortran2008 wiki status page: https://gcc.gnu.org/wiki/Fortran2008Status
The PR44646 (feature request) is closed now.
(In reply to Jürgen Reuter from comment #5)
> It appears that the link to this PR shall replace the link to PR4646 at the
> Fortran2008 wiki status page: https://gcc.gnu.org/wiki/Fortran2008Status
> The PR44646 (feature request) is closed now.
Typo: first PR should be also PR44646.