[flang-commits] [PATCH] D139044: [flang] Don't emit spurious error for polymorphic actual argument in PURE

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Nov 30 14:39:38 PST 2022


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
klausler requested review of this revision.

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.


https://reviews.llvm.org/D139044

Files:
  flang/lib/Semantics/check-call.cpp
  flang/lib/Semantics/definable.cpp
  flang/lib/Semantics/definable.h
  flang/test/Semantics/call28.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139044.479074.patch
Type: text/x-patch
Size: 3704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221130/7a70c824/attachment.bin>


More information about the flang-commits mailing list