blob: 60f251ab448358f07c1272a7e38acf1cc34fb3a8 [file] [log] [blame]
Kirill Bobyrev77f522c2016-08-10 13:28:30 +00001class Foo { /* Test 1 */ // CHECK: class Bar {
2public:
3 Foo() {} // CHECK: Bar() {}
4};
Kirill Bobyrev713bdc02016-07-15 10:21:33 +00005
Kirill Bobyrev5b7f0162016-07-27 13:37:22 +00006class Baz {
Kirill Bobyrev77f522c2016-08-10 13:28:30 +00007public:
8 operator Foo() /* Test 2 */ const { // CHECK: operator Bar() /* Test 2 */ const {
9 Foo foo; // CHECK: Bar foo;
Kirill Bobyrev713bdc02016-07-15 10:21:33 +000010 return foo;
11 }
12};
Kirill Bobyrev77f522c2016-08-10 13:28:30 +000013
14int main() {
15 Baz boo;
16 Foo foo = static_cast<Foo>(boo); // CHECK: Bar foo = static_cast<Bar>(boo);
17 return 0;
18}
19
20// Test 1.
21// RUN: clang-rename -offset=7 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
22// Test 2.
23// RUN: clang-rename -offset=164 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
24
25// To find offsets after modifying the file, use:
26// grep -Ubo 'Foo.*' <file>