diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-13 02:59:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-13 02:59:33 +0000 |
commit | 20ee0ed4eaefbf7dba08385137240682e81742e7 (patch) | |
tree | 2bf8728bdd4fc08150b51acb6a7f3922aef60633 /clang/test/SemaTemplate/instantiate-function-1.cpp | |
parent | 64e6529e76e33fef1447a0bb6a8e53469eaf4a9e (diff) | |
download | bcm5719-llvm-20ee0ed4eaefbf7dba08385137240682e81742e7.tar.gz bcm5719-llvm-20ee0ed4eaefbf7dba08385137240682e81742e7.zip |
If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.
llvm-svn: 73284
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-function-1.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<typename T> 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<T> *const' is not a structure or union}} } }; @@ -209,3 +209,9 @@ struct Abstract { 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; } +}; |