[flang] Improve message for assignment to subprogram
authorTim Keith <tkeith@nvidia.com>
Fri, 7 Aug 2020 03:33:59 +0000 (20:33 -0700)
committerTim Keith <tkeith@nvidia.com>
Fri, 7 Aug 2020 03:34:00 +0000 (20:34 -0700)
commitd8713523a2f5847ca69c8ef172578a915c129fe8
treee15ddbfe1e9806b02c3a9731665315301364bd3d
parentf13f2e16f00e8d23b49b0dfc58d63adc052d0222
[flang] Improve message for assignment to subprogram

In the example below we were producing the error message
"Assignment to constant 'f' is not allowed":
```
function f() result(r)
  f = 1.0
end
```

This changes it to a more helpful message when the LHS is a subprogram
name and also mentions the function result name when it's a function.

Differential Revision: https://reviews.llvm.org/D85483
flang/lib/Semantics/expression.cpp
flang/test/Semantics/assign04.f90