[flang-commits] [PATCH] D88075: [flang] CHARACTER(*) return does not require explicit interface

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Sep 22 01:20:22 PDT 2020


jeanPerier created this revision.
jeanPerier added reviewers: sscalpone, klausler, schweitz.
jeanPerier added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
jeanPerier requested review of this revision.

Fortran 2018 15.4.2.2(4)(c) says nonassumed or explicit non-constant
length parameter require explicit interface. The "nonassumed" part was
missing in f18 characteristic analysis causing CanBeCalledViaImplicitInterface
to return false for `CHARACTER(*) function foo()` like interfaces.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88075

Files:
  flang/lib/Evaluate/characteristics.cpp


Index: flang/lib/Evaluate/characteristics.cpp
===================================================================
--- flang/lib/Evaluate/characteristics.cpp
+++ flang/lib/Evaluate/characteristics.cpp
@@ -485,6 +485,8 @@
         if (const auto *param{type.charLength()}) {
           if (const auto &expr{param->GetExplicit()}) {
             return IsConstantExpr(*expr); // 15.4.2.2(4)(c)
+          } else if (param->isAssumed()) {
+            return true;
           }
         }
         return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88075.293375.patch
Type: text/x-patch
Size: 508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20200922/88f2f8dd/attachment.bin>


More information about the flang-commits mailing list