[PATCH] D14096: [clang-tidy] add new check cppcoreguidelines-pro-type-cstyle-cast

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 18:55:03 PST 2015


alexfh accepted this revision.
alexfh added a reviewer: alexfh.
alexfh added a comment.
This revision is now accepted and ready to land.

Looks good with a comment. Thank you for contribution!


================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-cstyle-cast.cpp:14
@@ +13,3 @@
+  i = (int*)j;
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: do not use C-style cast to cast away constness [cppcoreguidelines-pro-type-cstyle-cast]
+  j = (const int*)i; // OK, const added
----------------
I think, it makes sense to leave the `[cppcoreguidelines-pro-type-cstyle-cast]` only once and remove it everywhere else to make the test easier to read.


http://reviews.llvm.org/D14096





More information about the cfe-commits mailing list