[PATCH] Add readability-remove-void-arg check to clang-tidy
Alexander Kornienko
alexfh at google.com
Tue Mar 3 07:17:17 PST 2015
================
Comment at: clang-tidy/readability/RedundantVoidArg.cpp:41
@@ +40,3 @@
+bool protoTypeHasNoParms(QualType QT) {
+ if (const auto PT = QT->getAs<PointerType>()) {
+ QT = PT->getPointeeType();
----------------
Please use either "auto" or "const auto *" consistently. This function has usages of both.
================
Comment at: clang-tidy/readability/RemoveVoidArg.h:38
@@ +37,3 @@
+private:
+ bool CPlusPlusFile_;
+
----------------
LegalizeAdulthood wrote:
> alexfh wrote:
> > 1. You don't need to store this flag as it's easy and cheap to check it on each call to `check()`: it's available as `Result.Context->getLangOpts().CPlusPlus`.
> > 2. This name violates LLVM Naming conventions: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
> Thanks for showing me where I could get that option. I drilled around in the code for a while and couldn't find it except hanging off the Compiler. What would be really nice is if I could get ahold of that flag when I'm asked to add matchers as I could simply not add any matchers in that case, but `registerPPCallbacks` is called after `registerMatchers`. Can I navigate to it from `ClangTidyContext`?
Language options only become available when a compiler instance is being initialized. The matchers are registered way before that and then multiple different compilations may be run potentially with different options (if multiple translation units have been passed to clang-tidy).
So there's no way to learn what language will be analyzed when we register matchers.
http://reviews.llvm.org/D7639
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list