ASTConsumer::handleTopLevelDecl will end up getting called for

function template instantiations. Fixes <rdar://problem/10398005> / PR11312.

llvm-svn: 143984
This commit is contained in:
Douglas Gregor 2011-11-07 18:53:57 +00:00
parent 988ac00abd
commit 61d63d0fd7
2 changed files with 11 additions and 1 deletions

View File

@ -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();

View File

@ -0,0 +1,7 @@
int main()
{
return 0;
}
// RUN: c-index-test -write-pch %t.pch -fno-delayed-template-parsing -x c++-header %S/Inputs/reparse-instantiate.h
// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -fno-delayed-template-parsing -I %S/Inputs -include %t %s