================
@@ -430,6 +439,27 @@ locateASTReferent(SourceLocation CurLoc, const 
syntax::Token *TouchedIdentifier,
         continue;
       }
     }
+    // Special case: - (void)^method {} should jump to overrides, but the decl
+    // shouldn't, only the definition. Note that an Objective-C method can
+    // override a parent class or protocol.
+    //
+    // FIXME: Support jumping from a protocol decl to overrides on go-to
+    // definition.
+    if (const auto *OMD = llvm::dyn_cast<ObjCMethodDecl>(D)) {
+      if (TouchedIdentifier &&
+          objcMethodIsTouched(SM, OMD, TouchedIdentifier->location()) &&
+          OMD->isThisDeclarationADefinition()) {
----------------
DavidGoldman wrote:

Done

https://github.com/llvm/llvm-project/pull/127109
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to