aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-10 22:59:12 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-10 22:59:12 +0000
commitc4ccf01c1223ea13efc5b6dd19ca4916af0daf6a (patch)
tree5e1dc247814af08bd18af0bb4e081ccf0b5561da /lib/AST/ASTContext.cpp
parent7da97d0f31e1ec16998d3de2cfd2e88fe3736673 (diff)
The canonical declaration of a NULL declaration is NULL
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71409 91177308-0d34-0410-b5e6-96231b3b80d8
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)