forked from OSchip/llvm-project
clang-rename: handle non-inline ctor definitions when renaming classes
The result of the test was C::D(), not D::D(). Reviewers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20356 llvm-svn: 269952
This commit is contained in:
parent
a519cf593f
commit
5a6d2985d7
|
@ -79,6 +79,11 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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' <file> to get the correct offset of foo when changing
|
||||
// this file.
|
Loading…
Reference in New Issue