[all-commits] [llvm/llvm-project] c42862: [flang] Catch calls to assumed-length character fu...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue May 24 12:54:42 PDT 2022


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

  Changed paths:
    M flang/lib/Semantics/expression.cpp
    M flang/test/Evaluate/rewrite01.f90
    M flang/test/Lower/dummy-procedure-character.f90
    M flang/test/Lower/dummy-procedure-in-entry.f90
    M flang/test/Lower/host-associated.f90
    M flang/test/Semantics/call01.f90

  Log Message:
  -----------
  [flang] Catch calls to assumed-length character functions

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 and now get caught.

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.

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




More information about the All-commits mailing list