diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Index/IndexingContext.cpp | 7 | ||||
| -rw-r--r-- | clang/test/Index/Core/index-source.m | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Index/IndexingContext.cpp b/clang/lib/Index/IndexingContext.cpp index 0a235afc28b..3d1d9902dd6 100644 --- a/clang/lib/Index/IndexingContext.cpp +++ b/clang/lib/Index/IndexingContext.cpp @@ -290,14 +290,17 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc, Roles |= (unsigned)SymbolRole::Declaration; D = getCanonicalDecl(D); - if (D->isImplicit() && !isa<ObjCMethodDecl>(D)) { + if (D->isImplicit() && !isa<ObjCMethodDecl>(D) && + !(isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->getBuiltinID())) { // operator new declarations will link to the implicit one as canonical. return true; } Parent = adjustParent(Parent); if (Parent) Parent = getCanonicalDecl(Parent); - assert((!Parent || !Parent->isImplicit() || isa<FunctionDecl>(Parent) || + assert((!Parent || !Parent->isImplicit() || + (isa<FunctionDecl>(Parent) && + cast<FunctionDecl>(Parent)->getBuiltinID()) || isa<ObjCInterfaceDecl>(Parent) || isa<ObjCMethodDecl>(Parent)) && "unexpected implicit parent!"); diff --git a/clang/test/Index/Core/index-source.m b/clang/test/Index/Core/index-source.m index 6248f18bfb5..ac309c8e696 100644 --- a/clang/test/Index/Core/index-source.m +++ b/clang/test/Index/Core/index-source.m @@ -68,5 +68,6 @@ enum { // 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+2]]:12 | function/C | setjmp | c:@F@setjmp | _setjmp | Decl | rel: 0 // 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); |

