See: https://github.com/clangd/clangd/issues/668
struct A { virtual void foo(); }; struct B : A { void foo() override; };
Find refs on A::foo() will show:
- decls of A::foo()
- decls of B::foo()
- refs to A::foo()
- no refs to B::foo().
Differential D95812
[clangd] Report only decl of overridding method in xref. usaxena95 on Feb 1 2021, 12:23 PM. Authored by
Details See: https://github.com/clangd/clangd/issues/668 struct A { virtual void foo(); }; struct B : A { void foo() override; }; Find refs on A::foo() will show:
Diff Detail
Unit Tests
Event TimelineComment Actions This looks about right to me... The first of those patches introduces flags on returned refs to indicate which are decls/defs. I'd suggest adding an "override" flag and populating it for these results. (I guess the bug includes the other side of this, where if the method is an override, calls to base methods are reported. Makes sense to split it into a separate patch...) Comment Actions Thanks.
Yes. I plan to do that in a separate patch. |
I guess we should include the definition location as well?