When searching for the instantiation of a locally-scoped tag
declaration, also look for an instantiation of its previous
declarations. Fixes PR8801.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122361 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-local-class.cpp b/test/SemaTemplate/instantiate-local-class.cpp
index d57ba8a..954fd65 100644
--- a/test/SemaTemplate/instantiate-local-class.cpp
+++ b/test/SemaTemplate/instantiate-local-class.cpp
@@ -50,3 +50,16 @@
   struct S { };
   void test() { f<S>(); }
 }
+
+namespace PR8801 {
+  template<typename T>
+  void foo() {
+    class X;
+    int (X::*pmf)(T) = 0;
+    class X : public T { };
+  }
+
+  struct Y { };
+
+  template void foo<Y>();
+}