[flang] Fix merging of use associated generics
authorTim Keith <tkeith@nvidia.com>
Thu, 1 Aug 2019 20:06:25 +0000 (13:06 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 1 Aug 2019 20:06:25 +0000 (13:06 -0700)
commit723add0b8d211a9ca41c486fbe319fd3717080ce
treea28f537dee15a9ec8a89ad4486049553fc9a4414
parent5e39c9aa1d48a18360f0c77cddd94cbcf83641c4
[flang] Fix merging of use associated generics

When we use-associate a generic interface name and then add more
procedures to the generic, we create a new symbol for the merged
generic. That symbol has to include a pointer to the derived type
or procedure with the same name, just as the original generic did.

To achieve that, change `AddSpecificProcsFrom` to also copy those
fields from the original symbol and change its name to `CopyFrom`
to reflect its new purpose. Also, change it to take `GenericDetails`
instead of `Symbol` as its argument so we can't call it on the wrong
kind of symbol.

Original-commit: flang-compiler/f18@1e22970e4352775df8a32e018435743786a66280
Reviewed-on: https://github.com/flang-compiler/f18/pull/614
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.cc
flang/lib/semantics/symbol.h
flang/test/semantics/resolve18.f90