[flang-commits] [PATCH] D123705: [flang] Defer all function result type processing

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Apr 13 12:20:53 PDT 2022


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

When a type specification appears in the prefix of a FUNCTION statement,
defer its processing as late as possible so that any symbols in the
tpe specification can be resolved in the function's scope to local
declarations, including use-associated symbols.  f18 was already doing
this deferral in a limited form for derived types, and this patch
makes it work for intrinsic type parameter values as well.

In short, "real(kind(x)) function foo(x)" now works as it should.

"As late as possible" means the end of the specification part, or
the first appearance of the function result name in the specification
part.


https://reviews.llvm.org/D123705

Files:
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/resolve108.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123705.422594.patch
Type: text/x-patch
Size: 14385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220413/5f385cea/attachment-0001.bin>


More information about the flang-commits mailing list