diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-05-10 22:59:12 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-05-10 22:59:12 +0000 |
| commit | 5e4e50c2808aa9fca667f8ba50eb4b459b51c935 (patch) | |
| tree | 8b6210a8d06110ce22d2a2091689ff4a50c7d3ce /clang/lib/AST/ASTContext.cpp | |
| parent | e362cea5681e97c5606154558a3f2555511de9ee (diff) | |
| download | bcm5719-llvm-5e4e50c2808aa9fca667f8ba50eb4b459b51c935.tar.gz bcm5719-llvm-5e4e50c2808aa9fca667f8ba50eb4b459b51c935.zip | |
The canonical declaration of a NULL declaration is NULL
llvm-svn: 71409
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 3 |
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) |

