[clang-tools-extra] r280639 - [clang-rename] add failing test

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 4 15:28:40 PDT 2016


Author: omtcyfz
Date: Sun Sep  4 17:28:39 2016
New Revision: 280639

URL: http://llvm.org/viewvc/llvm-project?rev=280639&view=rev
Log:
[clang-rename] add failing test

For some reason clang-rename fails to rename method of templated class. Add
XFAIL test reproducing the issue.

Added:
    clang-tools-extra/trunk/test/clang-rename/TemplatedClassFunction.cpp

Added: clang-tools-extra/trunk/test/clang-rename/TemplatedClassFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/TemplatedClassFunction.cpp?rev=280639&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-rename/TemplatedClassFunction.cpp (added)
+++ clang-tools-extra/trunk/test/clang-rename/TemplatedClassFunction.cpp Sun Sep  4 17:28:39 2016
@@ -0,0 +1,22 @@
+template <typename T>
+class A {
+public:
+  void foo() /* Test 1 */ {}  // CHECK: void bar() /* Test 1 */ {}
+};
+
+int main(int argc, char **argv) {
+  A<int> a;
+  a.foo();   /* Test 2 */     // CHECK: a.bar()   /* Test 2 */
+  return 0;
+}
+
+// Test 1.
+// RUN: clang-refactor rename -offset=48 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 2.
+// RUN: clang-refactor rename -offset=162 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
+//
+// Currently unsupported test.
+// XFAIL: *
+
+// To find offsets after modifying the file, use:
+//   grep -Ubo 'foo.*' <file>




More information about the cfe-commits mailing list