diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-03-10 17:45:58 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-03-10 17:45:58 +0000 |
commit | 27c39af73c0d7d0b97e57b3a905040d4cefc9708 (patch) | |
tree | 56c1dd85a159948815817b5a90bedb39cf9ad105 /lib/AST/DeclCXX.cpp | |
parent | d2e6cf1d1c6468396ec057119c32aa58b1ee5ac9 (diff) | |
download | FreeBSD-src-27c39af73c0d7d0b97e57b3a905040d4cefc9708.zip FreeBSD-src-27c39af73c0d7d0b97e57b3a905040d4cefc9708.tar.gz |
Update clang to r98164.
Diffstat (limited to 'lib/AST/DeclCXX.cpp')
-rw-r--r-- | lib/AST/DeclCXX.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 9b693af..7f4ad34 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -636,11 +636,16 @@ QualType CXXMethodDecl::getThisType(ASTContext &C) const { assert(isInstance() && "No 'this' for static methods!"); - QualType ClassTy; - if (ClassTemplateDecl *TD = getParent()->getDescribedClassTemplate()) - ClassTy = TD->getInjectedClassNameType(C); - else - ClassTy = C.getTagDeclType(getParent()); + QualType ClassTy = C.getTypeDeclType(getParent()); + + // Aesthetically we prefer not to synthesize a type as the + // InjectedClassNameType of a template pattern: injected class names + // are printed without template arguments, which might + // surprise/confuse/distract our poor users if they didn't + // explicitly write one. + if (isa<InjectedClassNameType>(ClassTy)) + ClassTy = cast<InjectedClassNameType>(ClassTy)->getUnderlyingType(); + ClassTy = C.getQualifiedType(ClassTy, Qualifiers::fromCVRMask(getTypeQualifiers())); return C.getPointerType(ClassTy); |