From c4ccf01c1223ea13efc5b6dd19ca4916af0daf6a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 10 May 2009 22:59:12 +0000 Subject: [PATCH] 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 --- lib/AST/ASTContext.cpp | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.40.0