]> granicus.if.org Git - clang/commitdiff
[index] Fix assertion hit when indexing re-declarations of built-in functions.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 9 Mar 2016 02:12:40 +0000 (02:12 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 9 Mar 2016 02:12:40 +0000 (02:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262984 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Index/IndexingContext.cpp
test/Index/Core/index-source.m

index 204e4300f8788a4b2792e979f2f361ccf9e8d6c5..fe814ff25a643abb53f51b647a99434c14f1c614 100644 (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;
index d70974ca0349f3b7708c59d3e00471178584d941..6248f18bfb51c28cbf3b8d1061a621e9d6d1a5f4 100644 (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);