diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-27 13:58:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-27 13:58:59 +0200 |
commit | 7c0da317ebcd9ac8b1141d6fc0f3b6f4973563f4 (patch) | |
tree | 35545e5fe9f658c1b9bc203d3ddb0b59794bf5c0 | |
parent | 2a6a16bd178844e4c835e4e505ede3645b18e16c (diff) |
rework to avoid affecting "C c;"
-rw-r--r-- | clang/rename.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/rename.cxx b/clang/rename.cxx index 2ec5cd0..76e1655 100644 --- a/clang/rename.cxx +++ b/clang/rename.cxx @@ -312,13 +312,17 @@ public: /* * ... new C(...); <- Handles this. */ - bool VisitCXXConstructExpr(const clang::CXXConstructExpr* pExpr) + bool VisitCXXNewExpr(const clang::CXXNewExpr* pExpr) { - if (const clang::CXXConstructorDecl* pDecl = pExpr->getConstructor()) + if (const clang::CXXConstructExpr* pConstructExpr = pExpr->getConstructExpr()) { - std::string aName = pDecl->getNameAsString(); - RewriteText(pExpr->getLocation(), pDecl->getNameAsString().length(), aName); + if (const clang::CXXConstructorDecl* pDecl = pConstructExpr->getConstructor()) + { + std::string aName = pDecl->getNameAsString(); + RewriteText(pConstructExpr->getLocation(), pDecl->getNameAsString().length(), aName); + } } + return true; } |