Fortran 2018 introduced the capability to specify the type of the index in an implied do in an array constructor (i.e. an ac-implied-do - F2018 R774 for syntax, F2018 19.4p5 for description of the relevant scope rules). This appears in the documentation for the current oneAPI release (2022.1) - see here. The compiler seems to know about this feature... but trips over subsequent silliness.
PROGRAM ArrayConstructorWithTypeSpec IMPLICIT NONE INTEGER, ALLOCATABLE :: a(:) a = [(i, INTEGER :: i = 1, 10)] PRINT *, a END PROGRAM ArrayConstructorWithTypeSpec
>ifort /check:all /warn:all /standard-semantics "2022-01-04 array-constructor.f90" Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0 Build 20211109_000000 Copyright (C) 1985-2021 Intel Corporation. All rights reserved. 2022-01-04 array-constructor.f90(4): error #6404: This name does not have a type, and must have an explicit type. [I] a = [(i, INTEGER :: i = 1, 10)] ----------------------^ compilation aborted for 2022-01-04 array-constructor.f90 (code 1)
In the compilers documentation for array constructors (as linked above) - the expression provided for the assignment to C3 in one of the examples has a syntax error. The INTEGER :: type spec is in the wrong spot - it can either go before the second opening parenthesis (specifies the type of the entire constructor) or after the first comma (specifies the kind of the ac-do-variable, as per the feature discussed above).
The example later for the extension where mixed real kinds are accepted also presumably has a syntax error (missing closing parenthesis).
(Can those who prepare the downloadable html documentation (such as used for F1 help) please test things like the index on the Firefox browser - there are apparent attempts to use cross-origin objects that prevent the index and the like from functioning locally within that browser.)
An update for you...
- I added your reproducer to an outstanding bug for what looks like the same issue. Bug ID is CMPLRIL0-33539. There is an awful workaround... remove the IMPLICIT NONE.
- I filed DOC-9465 to correct the example in the Fortran Developer Guide and Reference.
- Still waiting for a reply about the .html files.