[index] Fix assertion hit when indexing re-declarations of built-in functions.

llvm-svn: 262984
This commit is contained in:
Argyrios Kyrtzidis 2016-03-09 02:12:40 +00:00
parent 3dbf9a31b5
commit 0ad65ac816
2 changed files with 6 additions and 0 deletions

View File

@ -298,6 +298,7 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc,
if (Parent)
Parent = getCanonicalDecl(Parent);
assert(!Parent || !Parent->isImplicit() ||
isa<FunctionDecl>(Parent) ||
isa<ObjCInterfaceDecl>(Parent) || isa<ObjCMethodDecl>(Parent));
SmallVector<SymbolRelation, 6> FinalRelations;

View File

@ -65,3 +65,8 @@ enum {
// CHECK-NEXT: RelChild | <no-name> | c:@Ea@One
Two,
};
// CHECK: [[@LINE+1]]:13 | typedef/C | jmp_buf | c:index-source.m@T@jmp_buf | <no-cgname> | Def | rel: 0
typedef int jmp_buf[(18)];
// CHECK: [[@LINE+1]]:19 | typedef/C | jmp_buf | c:index-source.m@T@jmp_buf | <no-cgname> | Ref | rel: 0
extern int setjmp(jmp_buf);