From 20ee0ed4eaefbf7dba08385137240682e81742e7 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 13 Jun 2009 02:59:33 +0000 Subject: If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383. llvm-svn: 73284 --- clang/test/SemaTemplate/instantiate-function-1.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'clang/test/SemaTemplate/instantiate-function-1.cpp') diff --git a/clang/test/SemaTemplate/instantiate-function-1.cpp b/clang/test/SemaTemplate/instantiate-function-1.cpp index 5b3a6d99840..023cc5437f6 100644 --- a/clang/test/SemaTemplate/instantiate-function-1.cpp +++ b/clang/test/SemaTemplate/instantiate-function-1.cpp @@ -140,7 +140,7 @@ template struct Member0 { 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 *const' is not a structure or union}} } }; @@ -209,3 +209,9 @@ struct Abstract { template struct TryCatch0; // okay template struct TryCatch0; // expected-note{{instantiation}} template struct TryCatch0; // expected-note{{instantiation}} + +// PR4383 +template struct X; +template struct Y : public X { + Y& x() { return *this; } +}; -- cgit v1.2.3