From: Argyrios Kyrtzidis Date: Wed, 9 Mar 2016 02:12:40 +0000 (+0000) Subject: [index] Fix assertion hit when indexing re-declarations of built-in functions. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09c709832bcd1873b02d4240031c250ddf00af2e;p=clang [index] Fix assertion hit when indexing re-declarations of built-in functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262984 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Index/IndexingContext.cpp b/lib/Index/IndexingContext.cpp index 204e4300f8..fe814ff25a 100644 --- a/lib/Index/IndexingContext.cpp +++ b/lib/Index/IndexingContext.cpp @@ -298,6 +298,7 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc, if (Parent) Parent = getCanonicalDecl(Parent); assert(!Parent || !Parent->isImplicit() || + isa(Parent) || isa(Parent) || isa(Parent)); SmallVector FinalRelations; diff --git a/test/Index/Core/index-source.m b/test/Index/Core/index-source.m index d70974ca03..6248f18bfb 100644 --- a/test/Index/Core/index-source.m +++ b/test/Index/Core/index-source.m @@ -65,3 +65,8 @@ enum { // CHECK-NEXT: RelChild | | c:@Ea@One Two, }; + +// CHECK: [[@LINE+1]]:13 | typedef/C | jmp_buf | c:index-source.m@T@jmp_buf | | Def | rel: 0 +typedef int jmp_buf[(18)]; +// CHECK: [[@LINE+1]]:19 | typedef/C | jmp_buf | c:index-source.m@T@jmp_buf | | Ref | rel: 0 +extern int setjmp(jmp_buf);