[all-commits] [llvm/llvm-project] 7efec1: [flang] Don't emit spurious error for polymorphic ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Fri Dec 2 13:17:22 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7efec1a40a9a0b7dd43cb4dbbd3b1285741d240b
      https://github.com/llvm/llvm-project/commit/7efec1a40a9a0b7dd43cb4dbbd3b1285741d240b
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-12-02 (Fri, 02 Dec 2022)

  Changed paths:
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/definable.cpp
    M flang/lib/Semantics/definable.h
    A flang/test/Semantics/call28.f90

  Log Message:
  -----------
  [flang] Don't emit spurious error for polymorphic actual argument in PURE

Definability checking is unconditionally flagging the use of a polymorphic
variable as an actual argument for a procedure reference in a PURE subprogram
unless the corresponding dummy is INTENT(IN).  This isn't necessary, since
an INTENT(OUT) polymorphic dummy is already caught as an error in the definition
of the callee, which must also be PURE; and an INTENT(IN OUT) or intent-free
dummy is allowed to be passed a polymorphic actual in a PURE context, with
any attempt to deallocate it being caught in the callee.

So add a flag to the definability checker to disable the "polymorphic
definition in PURE context" check when using it to check actual arguments.

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




More information about the All-commits mailing list