[cfe-commits] r58124 - /cfe/trunk/lib/AST/DeclCXX.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Fri Oct 24 15:28:19 PDT 2008
Author: akirtzidis
Date: Fri Oct 24 17:28:18 2008
New Revision: 58124
URL: http://llvm.org/viewvc/llvm-project?rev=58124&view=rev
Log:
Add a quote from the standard about the type of 'this'.
Modified:
cfe/trunk/lib/AST/DeclCXX.cpp
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=58124&r1=58123&r2=58124&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Fri Oct 24 17:28:18 2008
@@ -61,6 +61,12 @@
}
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())));
More information about the cfe-commits
mailing list