aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index f9d648b816..52eadef75a 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1704,6 +1704,9 @@ QualType ASTContext::getCanonicalType(QualType T) {
}
Decl *ASTContext::getCanonicalDecl(Decl *D) {
+ if (!D)
+ return 0;
+
if (TagDecl *Tag = dyn_cast<TagDecl>(D)) {
QualType T = getTagDeclType(Tag);
return cast<TagDecl>(cast<TagType>(T.getTypePtr()->CanonicalType)