Index: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp =================================================================== --- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp +++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp @@ -79,6 +79,11 @@ } } } + + if (getUSRForDecl(ConstructorDecl) == USR) { + // This takes care of the class name part of a non-inline ctor definition. + LocationsFound.push_back(ConstructorDecl->getLocStart()); + } return true; } Index: clang-tools-extra/trunk/test/clang-rename/CtorDefTest.cpp =================================================================== --- clang-tools-extra/trunk/test/clang-rename/CtorDefTest.cpp +++ clang-tools-extra/trunk/test/clang-rename/CtorDefTest.cpp @@ -0,0 +1,15 @@ +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=133 -new-name=D %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s +class C +{ +public: + C(); +}; + +C::C() // CHECK: D::D() +{ +} + +// Use grep -FUbo 'C' to get the correct offset of foo when changing +// this file.