[PATCH] D86107: [flang] Improve error messages for procedures in expressions

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 14:14:31 PDT 2020


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

When a procedure name was used on the RHS of an assignment we were not
reporting the error. When one was used in an expression the error
message wasn't very good (e.g. "Operands of + must be numeric; have
INTEGER(4) and untyped").

Detect these cases in ArgumentAnalyzer and emit better messages,
depending on whether the named procedure is a function or subroutine.

Procedure names may appear as actual arguments to function and
subroutine calls so don't report errors in those cases. That is the same
case where assumed type arguments are allowed, so rename `isAssumedType_`
to `isProcedureCall_` and use that to decide if it is an error.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86107

Files:
  flang/include/flang/Evaluate/tools.h
  flang/lib/Evaluate/tools.cpp
  flang/lib/Semantics/expression.cpp
  flang/test/Semantics/assign04.f90
  flang/test/Semantics/resolve63.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86107.286146.patch
Type: text/x-patch
Size: 5407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200817/3d461e31/attachment.bin>


More information about the llvm-commits mailing list