[all-commits] [llvm/llvm-project] 5d5d2a: [flang] Refine error checking in specification exp...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon May 9 17:55:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d5d2a0b197fa02abac5ccf295731ca826864ddd
      https://github.com/llvm/llvm-project/commit/5d5d2a0b197fa02abac5ccf295731ca826864ddd
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-05-09 (Mon, 09 May 2022)

  Changed paths:
    M flang/lib/Evaluate/check-expression.cpp
    M flang/lib/Evaluate/intrinsics.cpp
    M flang/test/Semantics/spec-expr.f90
    M flang/test/Semantics/symbol13.f90

  Log Message:
  -----------
  [flang] Refine error checking in specification expressions

The rules in the Fortran standard for specification expressions
are full of special cases and exceptions, and semantics didn't get
them exactly right.  It is valid to refer to an INTENT(OUT) dummy
argument in a specification expression in the context of a
specification inquiry function like SIZE(); it is not valid to
reference an OPTIONAL dummy argument outside of the context of
PRESENT.  This patch makes the specification expression checker
a little context-sensitive about whether it's examining an actual
argument of a specification inquiry intrinsic function or not.

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




More information about the All-commits mailing list