[PATCH] D13313: [clang-tidy] new check cppcoreguidelines-pro-type-reinterpret-cast
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 2 05:57:06 PDT 2015
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM with one minor nit. Thank you for working on this!
~Aaron
================
Comment at: clang-tidy/add_new_check.py:150
@@ -149,2 +149,3 @@
def adapt_module(module_path, module, check_name, check_name_camel):
- filename = os.path.join(module_path, module.capitalize() + 'TidyModule.cpp')
+ modulecpp = filter(lambda p: p.lower() == module.lower() + "tidymodule.cpp", os.listdir(module_path))[0]
+ filename = os.path.join(module_path, modulecpp)
----------------
Thank you for pointing this out, I hadn't realized we had a helper for this, let alone that it does the wrong thing for the new module I was working on. :-P
================
Comment at: clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp:30
@@ +29,3 @@
+ diag(MatchedCast->getOperatorLoc(),
+ "do not use reinterpret_cast (C++ Core Guidelines, rule Type.1)");
+}
----------------
I don't think we need the parenthetical any longer because the name of the checker will already be displayed to the user with the diagnostic.
http://reviews.llvm.org/D13313
More information about the cfe-commits
mailing list