If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73284 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp
index 5b3a6d9..023cc54 100644
--- a/test/SemaTemplate/instantiate-function-1.cpp
+++ b/test/SemaTemplate/instantiate-function-1.cpp
@@ -140,7 +140,7 @@
     tp->f;
 
     this->f;
-    this.f; // expected-error{{member reference base type 'struct Member0 *const' is not a structure or union}}
+    this.f; // expected-error{{member reference base type 'Member0<T> *const' is not a structure or union}}
   }
 };
 
@@ -209,3 +209,9 @@
 template struct TryCatch0<int>; // okay
 template struct TryCatch0<Incomplete*>; // expected-note{{instantiation}}
 template struct TryCatch0<Abstract>; // expected-note{{instantiation}}
+
+// PR4383
+template<typename T> struct X;
+template<typename T> struct Y : public X<T> {
+  Y& x() { return *this; }
+};