[flang] Resolve binding names in type-bound generic
authorTim Keith <tkeith@nvidia.com>
Fri, 8 Feb 2019 16:57:28 +0000 (08:57 -0800)
committerTim Keith <tkeith@nvidia.com>
Fri, 8 Feb 2019 16:57:28 +0000 (08:57 -0800)
commit69369e3b52f52a01d2753cd7ce4a5aba5f636fb8
treeb40746a4218aaab371ef3550eadfb70a171379dd
parent01377d5542335e6c3fdfaef00fce013a8e886f41
[flang] Resolve binding names in type-bound generic

Enhance `FindInTypeOrParents()` to also accept a `parser::Name` argument
and to resolve that name when the symbol is found. This causes binding
names in type-bound generic statements to be resolved. Move this process
to the beginning of the handling of such statements so that they are
resolve even if the generic spec is not and we return early.

Also resolve type parameter keywords in derived type specs
(e.g. `k` in `type(k=1) :: x`). That involves collecting and searching
the symbols of the `TypeParamDetails` to match the name with the symbol.

Original-commit: flang-compiler/f18@7387fb436d6d61bafe202f1d85a1e1ea824c7a32
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false
flang/lib/semantics/resolve-names.cc