[PATCH] D41661: [clangd] Don't navigate to forward class declaration when go to definition.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 3 04:26:20 PST 2018
hokein 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); });
----------------
ilya-biryukov wrote:
> 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.
Good point!
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D41661
More information about the cfe-commits
mailing list