- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to use construct names for multiply nested DO constructs, but when I try to have several instances of such a "multiply nested DO block" (i.e. with the same names) within one scope the compiler complains. Note that the named constructs having identical names are _not_ nested.
I cannot find anything in the standard (N1830) about this, and in the Ifort documentation there is no mention about this restriction in the section about the DO construct.
Did I miss something?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When trying to use an EXIT statement from an IF construct I incidentally came across this sentence regarding named IF constructs:
"The same construct name must not be used for different named constructs in the same scoping unit."
It seems that this applies to DO constructs aswell, but (as far as I can tell) it is not mentioned in the documentation...
Is this an Intel specific restriction?
PS: The reason I found this is that I was trying to use an EXIT from a named IF construct; is this feature coming in Ifort any time soon?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The restriction you want is in section 16.3.1 (Class of local identifiers) of Fortran 2008. A named construct is a local identifier of class (1). Paragraph 3 of that section says, "Within its scope, a local identifier of one class shall not be the same as another local identifier of the same class, ..."
As for EXIT out of non-loop blocks, that is a Fortran 2008 feature on our list for future implementation. I could not say when at this time.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page