]> granicus.if.org Git - clang/commitdiff
[libclang] indexing: for a synthesized property reference have the parent be the...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 9 Feb 2016 19:07:19 +0000 (19:07 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 9 Feb 2016 19:07:19 +0000 (19:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260253 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/IndexingContext.cpp

index 5d944bae1cb6f570e48c648b9bf2418313479115..7f65412f989b8334b92915275d6f3b7bb5f5e14a 100644 (file)
@@ -592,8 +592,9 @@ bool IndexingContext::handleObjCMethod(const ObjCMethodDecl *D) {
 bool IndexingContext::handleSynthesizedObjCProperty(
                                                 const ObjCPropertyImplDecl *D) {
   ObjCPropertyDecl *PD = D->getPropertyDecl();
-  return handleReference(PD, D->getLocation(), getCursor(D), nullptr,
-                         D->getDeclContext());
+  auto *DC = D->getDeclContext();
+  return handleReference(PD, D->getLocation(), getCursor(D),
+                         dyn_cast<NamedDecl>(DC), DC);
 }
 
 bool IndexingContext::handleSynthesizedObjCMethod(const ObjCMethodDecl *D,