summaryrefslogtreecommitdiffstats
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
commit5e4e50c2808aa9fca667f8ba50eb4b459b51c935 (patch)
tree8b6210a8d06110ce22d2a2091689ff4a50c7d3ce
parente362cea5681e97c5606154558a3f2555511de9ee (diff)
downloadbcm5719-llvm-5e4e50c2808aa9fca667f8ba50eb4b459b51c935.tar.gz
bcm5719-llvm-5e4e50c2808aa9fca667f8ba50eb4b459b51c935.zip
The canonical declaration of a NULL declaration is NULL
llvm-svn: 71409
-rw-r--r--clang/lib/AST/ASTContext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index f9d648b816b..52eadef75ab 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud