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 72341 clang-tidy/cert/StrToNumCheck.cpp
clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
clang-tidy/google/AvoidCStyleCastsCheck.cpp
clang-tidy/google/ExplicitConstructorCheck.cpp
clang-tidy/llvm/TwineLocalCheck.cpp
clang-tidy/misc/AssertSideEffectCheck.cpp
clang-tidy/misc/InaccurateEraseCheck.cpp
clang-tidy/misc/InefficientAlgorithmCheck.cpp
clang-tidy/misc/StringIntegerAssignmentCheck.cpp
clang-tidy/misc/SuspiciousStringCompareCheck.cpp
clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
clang-tidy/misc/UnusedAliasDeclsCheck.cpp
clang-tidy/misc/UnusedRAIICheck.cpp
clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tidy/modernize/PassByValueCheck.cpp
clang-tidy/modernize/RawStringLiteralCheck.cpp
clang-tidy/modernize/RedundantVoidArgCheck.cpp
clang-tidy/modernize/ShrinkToFitCheck.cpp
clang-tidy/modernize/UseOverrideCheck.cpp
clang-tidy/mpi/TypeMismatchCheck.cpp
clang-tidy/readability/AvoidConstParamsInDecls.cpp
clang-tidy/readability/ContainerSizeEmptyCheck.cpp
clang-tidy/readability/NamespaceCommentCheck.cpp
clang-tidy/readability/RedundantControlFlowCheck.cpp
clang-tidy/readability/RedundantSmartptrGetCheck.cpp
clang-tidy/readability/SimplifyBooleanExprCheck.cpp
clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp
clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
|