- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Happy New Year! This is a 3-fer, three bugs in one comment!
Let me look into these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now for issue #3... That's a known issue with Firefox. It's recommended that you use Chrome or Explorer. See the Fortran Developer Guide. There's a note on the main page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Issues #1 and #2 are fixed in the recent release of oneAPI version 2022.2. The ifort version is 2021.6.0.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page