[all-commits] [llvm/llvm-project] 4e90ca: [flang] Handle undeclared names in EQUIVALENCE sta...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Wed Dec 16 11:05:02 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e90cad6a6b5504f11b7876e26e80c2a079e04b0
      https://github.com/llvm/llvm-project/commit/4e90cad6a6b5504f11b7876e26e80c2a079e04b0
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2020-12-16 (Wed, 16 Dec 2020)

  Changed paths:
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/equivalence01.f90

  Log Message:
  -----------
  [flang] Handle undeclared names in EQUIVALENCE statements

Names in EQUIVALENCE statements are only allowed to indicate local
objects as per 19.5.1.4, paragraph 2, item (10).  Thus, a name appearing
in an EQUIVALENCE statement with no corresponding declaration in the
same scope is an implicit declaration of the name.  If that scope
contains an IMPLICIT NONE, it's an error.

I implemented this by adding a state variable to ScopeHandler to
indicate if we're resolving the names in an EQUIVALENCE statement and
then checked this state when resolving names.  I also added a test to
the existing tests for EQUIVALENCE statements.

Differential Revision: https://reviews.llvm.org/D93345




More information about the All-commits mailing list