[flang] Allow forward reference to binding name in type-bound generic
authorTim Keith <tkeith@nvidia.com>
Tue, 16 Jul 2019 00:09:03 +0000 (17:09 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 16 Jul 2019 00:09:03 +0000 (17:09 -0700)
commit16356d58bcbb66e876ead7bc7260c6bbee01aa34
treefc84bdc327da3b81c9820ddd932f85e528ce3b19
parent66a7639f499d59575ba8bae46bb1619f235735aa
[flang] Allow forward reference to binding name in type-bound generic

Type-bound generic statements can have binding names that refer to
bindings that occur later in the type. So save a map of generic to
binding names and process them when we get to the end of the
type-bound procedure part. This is similar to how specific procedures
of generic identifiers are handled.

Also detect duplicate binding names for a type-bound generic.

Fixes issue flang-compiler/f18#572.

Original-commit: flang-compiler/f18@d58bb77cfa8cde2838a5eaba3e44956bdaa042e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/577
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.h
flang/test/semantics/resolve38.f90