In some cases do not register the matcher when the check method of a checker should not run anyways.
Refactor some checks to use a shorter way to get language options.
Paths
| Differential D24881
[clang-tidy] Cleaning up language options. ClosedPublic Authored by xazax.hun on Sep 23 2016, 1:35 PM.
Details Summary In some cases do not register the matcher when the check method of a checker should not run anyways. Refactor some checks to use a shorter way to get language options.
Diff Detail
Event Timelinexazax.hun updated this object. Comment Actions I think will be good idea to enable modernize-loop-convert, modernize-use-auto, modernize-use-default, modernize-use-nullptr only in C++11 mode. Probably modernize-avoid-bind code code be simplified too. Comment Actions
As far as I can see there is a discrepancy between these modernization checks. Loop convert, use auto, use default, use nullptr is registered for older standards deliberately. See the following comment: // Only register the matchers for C++. Because this checker is used for // modernization, it is reasonable to run it on any C++ standard with the // assumption the user is trying to modernize their codebase. So basically the question is: should we require the users to run the clang tidy in C++11 mode (hence change their build settings) to get these modernization checks? I am okay with either of the answers but I wonder what do you think. Comment Actions I think it's reasonable to compile code in C++11 with minimal changes (only modernize-replace-auto-ptr is really needed) and test it before further modernization. alexfh edited edge metadata. Comment ActionsThank you for the cleanup! Please clang-format-diff the files before submitting. Otherwise looks good. This revision is now accepted and ready to land.Sep 23 2016, 6:30 PM Closed by commit rL282319: [clang-tidy] Cleaning up language options. (authored by xazax). · Explain WhySep 23 2016, 7:22 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 72387 clang-tools-extra/trunk/clang-tidy/cert/StrToNumCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/StringIntegerAssignmentCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/SuspiciousStringCompareCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp
clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp
clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
|