diff options
| -rw-r--r-- | clang-tools-extra/clang-rename/USRFinder.cpp | 4 | ||||
| -rw-r--r-- | clang-tools-extra/test/clang-rename/UserDefinedConversion.cpp | 8 | 
2 files changed, 5 insertions, 7 deletions
diff --git a/clang-tools-extra/clang-rename/USRFinder.cpp b/clang-tools-extra/clang-rename/USRFinder.cpp index 809cfcf460f..b64b20d54bf 100644 --- a/clang-tools-extra/clang-rename/USRFinder.cpp +++ b/clang-tools-extra/clang-rename/USRFinder.cpp @@ -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: diff --git a/clang-tools-extra/test/clang-rename/UserDefinedConversion.cpp b/clang-tools-extra/test/clang-rename/UserDefinedConversion.cpp index e810d12b9ac..9f61bf08c42 100644 --- a/clang-tools-extra/test/clang-rename/UserDefinedConversion.cpp +++ b/clang-tools-extra/test/clang-rename/UserDefinedConversion.cpp @@ -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;    }  | 

