[PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

Samuel Benzaquen via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 09:59:15 PDT 2015


sbenza added inline comments.

================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:28
@@ +27,3 @@
+
+  auto P0 = static_cast<Derived*>(new Base());
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to downcast from a base to a derived class [cppcoreguidelines-pro-type-static-cast-downcast]
----------------
I just noticed that we don't have any test with
  static_cast<const Derived*>(...)  or static_cast<const Derived&>
We should make sure that works.


http://reviews.llvm.org/D13368





More information about the cfe-commits mailing list