Testcase by Kirill Bobyrev.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This one doesn't fix it though.
It only deals with declarations of overridden functions.
This is the test that still fails:
/ RUN: cat %s > %t.cpp // RUN: clang-rename -offset=161 -new-name=boo %t.cpp -i -- // RUN: sed 's,//.*,,' %t.cpp | FileCheck %s // XFAIL: * class A { public: virtual void foo() {} }; class B : public A { public: void foo() override {} // OK: B::foo overrides A::foo }; int main() { A a; a.foo(); B b; b.foo(); return 0; } // Use grep -FUbo 'Cla' <file> to get the correct offset of foo when changing // this file.
Comment Actions
Hi!
Sorry for a late response.
The issue is that you only deal with the consequences of this "bug". Overridden functions simply have different USRs, so the solution is just to add relevant USRs. Trying to deal with it in USRLocFinder.cpp doesn't seem right; the chances of dealing with such issue correctly on that side are very small. I.e. it still doesn't pass the more complicated test I have in my patch (see below).
There's a patch I've been working on lately, it does exactly that. https://reviews.llvm.org/D22408 (it's from the other account I'll have to use from now, nvm)