diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-07 18:53:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-07 18:53:57 +0000 |
commit | 66e870029fdc1a36e79e62fd64430b527a318868 (patch) | |
tree | fdaf51926e6dce5cb5a308f77b6ad708be71786e /lib/Frontend/ASTUnit.cpp | |
parent | a33849b368b0973e64ee9c49af4c080a59f99eb4 (diff) |
ASTConsumer::handleTopLevelDecl will end up getting called for
function template instantiations. Fixes <rdar://problem/10398005> / PR11312.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 8d2884f750..2496f72bea 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -2480,7 +2480,10 @@ static inline bool compLocDecl(std::pair<unsigned, Decl *> L, void ASTUnit::addFileLevelDecl(Decl *D) { assert(D); - assert(!D->isFromASTFile() && "This is only for local decl"); + + // We only care about local declarations. + if (D->isFromASTFile()) + return; SourceManager &SM = *SourceMgr; SourceLocation Loc = D->getLocation(); |