[PATCH] D21012: clang-rename: implement renaming of classes inside static_cast

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 6 00:36:25 PDT 2016


klimek added inline comments.

================
Comment at: test/clang-rename/StaticCastExpr.cpp:4-25
@@ +3,24 @@
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class Base
+{
+};
+
+class Derived : public Base
+{
+public:
+  int getValue() const
+  {
+      return 0;
+  }
+};
+
+int main()
+{
+  Derived D;
+  const Base &Reference = D;
+  const Base *Pointer = &D;
+
+  static_cast<const Derived&>(Reference).getValue(); // CHECK: static_cast<const X&>
+  static_cast<const Derived*>(Pointer)->getValue(); // CHECK: static_cast<const X*>
+}
+
----------------
Please run this through clang-format.


http://reviews.llvm.org/D21012





More information about the cfe-commits mailing list