Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-rename] fix bug with initializer lists
Clang-rename is currently not able to find a symbol in initializer list. This patch fixes described issue. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D23193 llvm-svn: 278099
- Loading branch information
1 parent
a10549d
commit 31fd7fb
Showing
3 changed files
with
30 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
// RUN: cat %s > %t.cpp | ||
// RUN: clang-rename -offset=148 -new-name=Bar %t.cpp -i -- | ||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s | ||
|
||
class Baz { | ||
int Foo; // CHECK: Bar; | ||
int Foo; /* Test 1 */ // CHECK: int Bar; | ||
public: | ||
Baz(); | ||
}; | ||
|
||
Baz::Baz() : Foo(0) {} // CHECK: Baz::Baz() : Bar(0) {} | ||
Baz::Baz() : Foo(0) /* Test 2 */ {} // CHECK: Baz::Baz() : Bar(0) | ||
|
||
// Test 1. | ||
// RUN: clang-rename -offset=18 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s | ||
// Test 2. | ||
// RUN: clang-rename -offset=89 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s | ||
|
||
// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when changing | ||
// this file. | ||
// To find offsets after modifying the file, use: | ||
// grep -Ubo 'Foo.*' <file> |