[cfe-commits] r71409 - /cfe/trunk/lib/AST/ASTContext.cpp

Douglas Gregor dgregor at apple.com
Sun May 10 15:59:12 PDT 2009


Author: dgregor
Date: Sun May 10 17:59:12 2009
New Revision: 71409

URL: http://llvm.org/viewvc/llvm-project?rev=71409&view=rev
Log:
The canonical declaration of a NULL declaration is NULL

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=71409&r1=71408&r2=71409&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Sun May 10 17:59:12 2009
@@ -1704,6 +1704,9 @@
 }
 
 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)





More information about the cfe-commits mailing list