[PATCH] D41661: [clangd] Don't navigate to forward class declaration when go to definition.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 3 02:34:00 PST 2018


ilya-biryukov added inline comments.


================
Comment at: clangd/XRefs.cpp:68
+      // declaration, and it could be a forward declaration.
+      auto Def = std::find_if(D->redecls_begin(), D->redecls_end(),
+                              [](const Decl *D) { return IsDefinition(D); });
----------------
That seems like a useful helper on its own, maybe create a helper called `Decl* getDefinition(Decl* D)` and use it instead?
It's implementation can be as short as the one we currently have for `IsDefinition`, since all interesting `Decl` types have `getDefinition` method.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41661





More information about the cfe-commits mailing list