[flang] Prevent RESULT name from being the same as the function.
authorJean Perier <jperier@nvidia.com>
Fri, 13 Sep 2019 16:44:05 +0000 (09:44 -0700)
committerJean Perier <jperier@nvidia.com>
Fri, 13 Sep 2019 16:44:05 +0000 (09:44 -0700)
commitca8630845384d6a3ecd0b1653bcf31076ba75a06
treed194770b5731fc19822cac5cc317f4db90846a99
parentfe221123224d1f4df94a8739493b9b0f0aaef298
[flang] Prevent RESULT name from being the same as the function.
Fix flang-compiler/f18#726.
Add test and error messsage for such scenario and set error on the
result symbol because it is unclear what it is inside the function.

Original-commit: flang-compiler/f18@a3d5b5af0d4a2537e2cd1cf84cae16e622d2c50c
Reviewed-on: https://github.com/flang-compiler/f18/pull/743
Tree-same-pre-rewrite: false
flang/lib/semantics/resolve-names.cc
flang/test/semantics/resolve59.f90