[flang] Fix bug resolving type in type definition
authorTim Keith <tkeith@nvidia.com>
Tue, 9 Jun 2020 21:14:01 +0000 (14:14 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 9 Jun 2020 21:14:03 +0000 (14:14 -0700)
commita27d3852095a461b739da534ddc9abfb625f2e06
tree656330f8615334f5334526e5bea2b623b26b944a
parent2c0afacada0d1488bc88b1211203ea4fdb0a23e8
[flang] Fix bug resolving type in type definition

When we encountered a type name in a derived type definition, we were
sometimes finding a component of that name rather than the type from
the enclosing scope. Fix this by introducing `NonDerivedTypeScope()` to
start the search in the right scope.

Differential Revision: https://reviews.llvm.org/D81493
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/resolve92.f90 [new file with mode: 0644]