[flang-commits] [PATCH] D126148: [flang] Catch calls to assumed-length character functions

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Sat May 21 22:14:04 PDT 2022


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

Semantics was allowing calls to CHARACTER(*) functions, which are odd
things -- they can be declared, and passed around, but can never actually
be called as such.  They must be redeclared with an explicit length that
ends up being passed as a hidden argument.  So check for these calls
and diagnose them, add tests, and clean up some existing tests that
were in error.

Possible TODO for lowering: there were some test cases that used
bad calls to assumed-length CHARACTER*(*) functions and validated
their implementations.  I've removed some, and adjusted another,
but the code that somehow implemented these calls may need to be
removed and replaced with an assert about bad semantics.


https://reviews.llvm.org/D126148

Files:
  flang/lib/Semantics/expression.cpp
  flang/test/Evaluate/rewrite01.f90
  flang/test/Lower/dummy-procedure-character.f90
  flang/test/Lower/host-associated.f90
  flang/test/Semantics/call01.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126148.431205.patch
Type: text/x-patch
Size: 17698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220522/f929fd06/attachment-0001.bin>


More information about the flang-commits mailing list