Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct names check misses inclusive scope rule #1103

Open
kiranchandramohan opened this issue Apr 7, 2020 · 1 comment
Open

Construct names check misses inclusive scope rule #1103

kiranchandramohan opened this issue Apr 7, 2020 · 1 comment
Assignees

Comments

@kiranchandramohan
Copy link
Collaborator

For the program given below (or a similar program where block with name lp replaced by do loops) f18 does not detect the semantic error that a scope cannot have constructs with the same name.

program scope
  lp: block
  end block lp
  block
    lp: block
      if (k==20) exit lp
    end block lp
  end block
end program

Construct names are local identifiers and scope of local identifiers include the scopes in nested block constructs. And names cannot clash in the same scope. The relevant portion of Fortran 2018 standard given below.

19.3 Local identifiers
19.3.1 Classes of local identifiers
1 Identifiers of entities, other than statement or construct entities (19.4), in the classes
(1) named variables, named constants, named procedure pointers, named constructs, statement functions, ...

19.1
1 An entity is identified by an identifier.
2 The scope of
• a local identifier is an inclusive scope,

19.3
Within its scope, a local identifier of one class shall not be the same as another local identifier of the same class, ....

3.87 inclusive scope
nonblock scoping unit plus every block scoping unit whose host is that scoping unit or that is nested within such a block scoping unit
Note 1 to entry: That is, inclusive scope is the scope as if BLOCK constructs were not scoping units.

3.123.1
block scoping unit
scoping unit of a BLOCK construct

@kiranchandramohan
Copy link
Collaborator Author

https://github.com/banach-space is looking into this issue. @sscalpone Can this issue be assigned to him?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants