Clang Project

clang_source_code/test/clang-rename/TemplatedClassFunction.cpp
1template <typename T>
2class A {
3public:
4  void foo() /* Test 1 */ {}  // CHECK: void bar() /* Test 1 */ {}
5};
6
7int main(int argc, char **argv) {
8  A<int> a;
9  A<double> b;
10  A<float> c;
11  a.foo();   /* Test 2 */     // CHECK: a.bar();   /* Test 2 */
12  b.foo();   /* Test 3 */     // CHECK: b.bar();   /* Test 3 */
13  c.foo();   /* Test 4 */     // CHECK: c.bar();   /* Test 4 */
14  return 0;
15}
16
17// Test 1.
18// RUN: clang-rename -offset=48 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
19// Test 2.
20// RUN: clang-rename -offset=191 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
21// Test 3.
22// RUN: clang-rename -offset=255 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
23// Test 4.
24// RUN: clang-rename -offset=319 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
25
26// To find offsets after modifying the file, use:
27//   grep -Ubo 'foo.*' <file>
28