[flang-commits] [PATCH] D142753: [flang] Correct procedure pointer (or dummy) compatibility check

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jan 27 09:32:07 PST 2023


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

Fix a subtle bug in procedure compatibility checking with base
derived types vs. their extensions to ensure that a procedure 
expecting an extended type cannot be associated with a pointer
(or dummy procedure) to a procedure expecting a base type.

  subroutine s1(base); ... subroutine s2(extended)
  procedure(s1), pointer :: p
  p => s2 ! <- must be caught as an error


https://reviews.llvm.org/D142753

Files:
  flang/lib/Evaluate/characteristics.cpp
  flang/lib/Evaluate/formatting.cpp
  flang/lib/Evaluate/type.cpp
  flang/lib/Semantics/expression.cpp
  flang/test/Semantics/assign09.f90
  flang/test/Semantics/assign12.f90
  flang/test/Semantics/call05.f90
  flang/test/Semantics/global01.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142753.492808.patch
Type: text/x-patch
Size: 7572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230127/277942db/attachment-0001.bin>


More information about the flang-commits mailing list