(j3.2006) statement labels and scope

Robert Corbett robert.corbett
Thu Jan 14 18:19:53 EST 2016

On 01/14/16 12:56, Bill Long wrote:
> In 3.2.5 Statement labels we say that a statement label shall not be given to more than one statement ?in its scope?.  Since BLOCK constructs are scopes, if this is taken as stated, the following
> subroutine sub
> 10 continue
> block
> 10 continue
> end block
> end subroutine sub
> should be conforming.  In, instead, we actually meant ?inclusive scope?, then it would not be.  Personally, I think that allowing this is preferred, and would not require a wording change.   But I?m checking because I see inconsistent behavior with different compilers.  (And this is in one of my clauses to read this time).

We did mean inclusive scope.  The section on scopes makes this clear.

Subclause 16.1 of 10-007r states

       The scope of ... a local identifier is its inclusive scope.

Subclause 16.3.1 says that statement labels are local identifiers.
Subclause 16.4 does not say that statement labels can be statement
or construct entities.

Bob Corbett

More information about the J3 mailing list