[flang] Fix bug with generic and specific having same name
authorTim Keith <tkeith@nvidia.com>
Thu, 8 Aug 2019 23:52:36 +0000 (16:52 -0700)
committerTim Keith <tkeith@nvidia.com>
Fri, 9 Aug 2019 00:05:49 +0000 (17:05 -0700)
commitdd8601162bab144870ef101aa058c0f35bd0ee4e
tree45345f52af0876c9b919e419296fa51bf11c5314
parentca973fc355aa2de1f4b49fb92b79a2062212a758
[flang] Fix bug with generic and specific having same name

If a generic interface had a specific procedure with the same name that
is specified by an interface body, it was not handled correctly.

We were replacing the generic symbol with the symbol for the specific
procedure. Instead, leave the generic symbol in the scope and just
insert the new symbol for the specific into the generic.

Also, don't do distinguishability checks when one of the specific
procedures already has an error.

Fixes flang-compiler/f18#587.

Original-commit: flang-compiler/f18@2e905656758d7214635fb96a612760405b368b09
Reviewed-on: https://github.com/flang-compiler/f18/pull/640
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.cc
flang/test/semantics/modfile07.f90