From: Douglas Gregor Date: Sun, 10 May 2009 22:59:12 +0000 (+0000) Subject: The canonical declaration of a NULL declaration is NULL X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4ccf01c1223ea13efc5b6dd19ca4916af0daf6a;p=clang 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 --- 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(D)) { QualType T = getTagDeclType(Tag); return cast(cast(T.getTypePtr()->CanonicalType)