When triggering rename of the class name in the code with explicit destructor
calls, rename fails. Consider the following piece of code:
class Foo; ... Foo f; f.~/*...*/Foo();
findExplicitReferences will report two ReferenceLoc for destructor call:
one is comming from MemberExpr (i.e. destructor call itself) and would point
to the tilde:
f.~/*...*/Foo(); ^
And the second one is pointing to the typename and is coming from TypeLoc.
f.~/*...*/Foo(); ^
This causes rename to produce incorrect textual replacements. This patch
updates MemberExpr handler to detect destructor calls and prevents it
from reporting a duplicate reference.
I think we should use E->getFoundDecl() here, could you add a test case for calling base destructor explicitly, e.g. derived->base::~base()?