Add a quote from the standard about the type of 'this'.

llvm-svn: 58124
This commit is contained in:
Argyrios Kyrtzidis 2008-10-24 22:28:18 +00:00
parent 98ca36f009
commit 962c20e6f3
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ CXXMethodDecl::Create(ASTContext &C, CXXRecordDecl *RD,
}
QualType CXXMethodDecl::getThisType(ASTContext &C) const {
// C++ 9.3.2p1: The type of this in a member function of a class X is X*.
// If the member function is declared const, the type of this is const X*,
// if the member function is declared volatile, the type of this is
// volatile X*, and if the member function is declared const volatile,
// the type of this is const volatile X*.
assert(isInstance() && "No 'this' for static methods!");
QualType ClassTy = C.getTagDeclType(const_cast<CXXRecordDecl*>(
cast<CXXRecordDecl>(getParent())));