mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
ASTConsumer::handleTopLevelDecl will end up getting called for
function template instantiations. Fixes <rdar://problem/10398005> / PR11312. llvm-svn: 143984
This commit is contained in:
parent
988ac00abd
commit
61d63d0fd7
@ -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();
|
||||
|
7
clang/test/Index/reparse-instantiate.cpp
Normal file
7
clang/test/Index/reparse-instantiate.cpp
Normal 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
|
Loading…
Reference in New Issue
Block a user