[PATCH] D111039: [clangd] Include refs of base method in refs for derived method.
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 5 01:25:11 PDT 2021
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.
thanks, lgtm!
================
Comment at: clang-tools-extra/clangd/XRefs.cpp:1397
+ OverriddenBy.Subjects.insert(ID);
getOverriddenMethods(CMD, OverriddenMethods);
}
----------------
note that there's a behaviour change here as well. not sure how often it matters in practice, but previously we would still get the overriden methods for a symbol even if we fail to generate symbolid for it. let's keep it the same.
================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:1783
ReferencesResult::Override)));
- EXPECT_THAT(
- findReferences(AST, T.point(), 0, UseIndex ? TU.index().get() : nullptr)
- .References,
- UnorderedElementsAreArray(ExpectedLocations))
- << Test;
+ for (const auto &P : T.points())
+ EXPECT_THAT(findReferences(AST, P, 0, UseIndex ? TU.index().get() : nullptr)
----------------
nit: I'd add braces here, even though this is still a single statement, it spans multiple lines and becomes confusing.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111039/new/
https://reviews.llvm.org/D111039
More information about the cfe-commits
mailing list