summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp6
-rw-r--r--clang/lib/AST/DeclCXX.cpp9
2 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 404593452c2..d31f1fb16e1 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2029,9 +2029,11 @@ QualType ASTContext::getDecltypeType(Expr *e) {
/// getTagDeclType - Return the unique reference to the type for the
/// specified TagDecl (struct/union/class/enum) decl.
-QualType ASTContext::getTagDeclType(TagDecl *Decl) {
+QualType ASTContext::getTagDeclType(const TagDecl *Decl) {
assert (Decl);
- return getTypeDeclType(Decl);
+ // FIXME: What is the design on getTagDeclType when it requires casting
+ // away const? mutable?
+ return getTypeDeclType(const_cast<TagDecl*>(Decl));
}
/// getSizeType - Return the unique type for "size_t" (C99 7.17), the result
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 52619e99207..e07eae7b20a 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -379,9 +379,7 @@ QualType CXXMethodDecl::getThisType(ASTContext &C) const {
if (ClassTemplateDecl *TD = getParent()->getDescribedClassTemplate())
ClassTy = TD->getInjectedClassNameType(C);
else
- // FIXME: What is the design on getTagDeclType when it requires casting
- // away const? mutable?
- ClassTy = C.getTagDeclType(const_cast<CXXRecordDecl*>(getParent()));
+ ClassTy = C.getTagDeclType(getParent());
ClassTy = ClassTy.getWithAdditionalQualifiers(getTypeQualifiers());
return C.getPointerType(ClassTy);
}
@@ -466,10 +464,9 @@ CXXConstructorDecl::isCopyConstructor(ASTContext &Context,
return false;
// Is it a reference to our class type?
- QualType PointeeType
+ QualType PointeeType
= Context.getCanonicalType(ParamRefType->getPointeeType());
- QualType ClassTy
- = Context.getTagDeclType(const_cast<CXXRecordDecl*>(getParent()));
+ QualType ClassTy = Context.getTagDeclType(getParent());
if (PointeeType.getUnqualifiedType() != ClassTy)
return false;
OpenPOWER on IntegriCloud