[clang-rename] skip CXXConversionDecl while searching for NamedDecl

llvm-svn: 276866
This commit is contained in:
Kirill Bobyrev 2016-07-27 13:37:22 +00:00
parent 9163ca0fc7
commit 5b7f016f41
2 changed files with 5 additions and 7 deletions

View File

@ -52,8 +52,8 @@ public:
// checking if the point lies within the length of the name of the declaration
// and the start location is sufficient.
bool VisitNamedDecl(const NamedDecl *Decl) {
return setResult(Decl, Decl->getLocation(),
Decl->getNameAsString().length());
return dyn_cast<CXXConversionDecl>(Decl) ? true :
setResult(Decl, Decl->getLocation(), Decl->getNameAsString().length());
}
// Expression visitors:

View File

@ -1,12 +1,10 @@
// Currently unsupported test.
// RUN: cat %s > %t.cpp
// FIXME: clang-rename should handle conversions from a class type to another
// type.
// RUN: clang-rename -offset=143 -new-name=Bar %s -- | FileCheck %s
class Foo {}; // CHECK: class Bar {};
class Baz { // CHECK: class Bar {
class Baz {
operator Foo() const { // CHECK: operator Bar() const {
// offset ^
Foo foo; // CHECK: Bar foo;
return foo;
}