diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-27 16:24:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-27 16:24:06 +0200 |
commit | 7e693aff1ad0437b6e8e689fce7e29d62ede9f4e (patch) | |
tree | 8e68138fc3423ce98578b5ef7f0671bf521f7d9f | |
parent | b0485ecbf435dc984c8a1a0251279ce2bb502b37 (diff) |
fix dtors
-rw-r--r-- | clang/rename.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/rename.cxx b/clang/rename.cxx index d777f76..51b121e 100644 --- a/clang/rename.cxx +++ b/clang/rename.cxx @@ -239,18 +239,22 @@ public: { std::string aName = pDecl->getNameAsString(); std::string aPrefix("~"); - if (pDecl->isThisDeclarationADefinition()) + if (pDecl->getLocStart() != pDecl->getLocation()) + { /* * Foo::~Foo(...) {} * ^~~ Handles this. */ - RewriteText(pDecl->getLocStart(), pDecl->getNameAsString().length() - aPrefix.size(), aName.substr(aPrefix.size())); + if (!HasNamespace(aName.substr(aPrefix.size())) || pDecl->isThisDeclarationADefinition()) + RewriteText(pDecl->getLocStart(), pDecl->getNameAsString().length() - aPrefix.size(), aName.substr(aPrefix.size())); + } /* * Foo::~Foo(...) {} * ^~~ Handles this. */ - RewriteText(pDecl->getLocation(), pDecl->getNameAsString().length(), aName, aPrefix); + if (!HasNamespace(aName.substr(aPrefix.size()))) + RewriteText(pDecl->getLocation(), pDecl->getNameAsString().length(), aName, aPrefix); return true; } |