Simplify, and improve the performance of, template instantiation for
declaration references. The key realization is that dependent Decls,
which actually require instantiation, can only refer to the current
instantiation or members thereof. And, since the current context
during instantiation contains all of those members of the current
instantiation, we can simply find the real instantiate that matches up
with the "current instantiation" template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72486 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-declref.cpp b/test/SemaTemplate/instantiate-declref.cpp
index 3b6db38..0e1e562 100644
--- a/test/SemaTemplate/instantiate-declref.cpp
+++ b/test/SemaTemplate/instantiate-declref.cpp
@@ -24,6 +24,9 @@
               K1 k1 = K1Val;
               Kind1 = K1Val;
               Outer::Inner::InnerTemplate<type>::VeryInner::Kind2 = K2Val;
+
+              InnerTemplate t;
+              InnerTemplate<type> t2;
             }
           };
         };