[PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 1 05:58:10 PDT 2015


alexfh added a comment.

In http://reviews.llvm.org/D13313#257476, @aaron.ballman wrote:

> As a slightly more broad question: I think we should have a user-customizable way to categorize these checks so that you can enable/disable them with finer-grained control. Some of the existing checkers already cover the Cpp guidelines, and we'll likely be adding plenty more. There's quite likely overlap with Google and LLVM checkers, etc. It would be really nice if we had a way to say: -checks=-*, CppGuidelines or -checks=-*, CERT, etc.
>
> (I'm not suggesting this as part of this patch, but I think it is an idea we should consider exploring because style guidelines abound: the new C++ ones, MISRA, CERT, joint strike fighter, etc. User-customizable categorization would really help for this sort of thing. This would help assuage my issue with the checker being on by default in misc-* -- it could be off in misc-* but on in cppcoreguidelines-*, for instance.)
>
> ~Aaron


One way we could get CppCoreGuidelines checks available for easy enabling as a whole is to create a separate module and register all relevant checks there with names relevant to the CppCoreGuidelines (e.g. register the `clang::tidy::google::ExplicitConstructorCheck` there as "cppcoreguidelines-rc-explicit"). If a checks needs to be slightly modified in order to be closer to a specific rule, we might add some check options and configure proper defaults in the `CppCoreGuidelinesModule::getModuleOptions()`. If a larger change in behavior is needed, we could inherit from existing checks as well.


http://reviews.llvm.org/D13313





More information about the cfe-commits mailing list