diff options
author | Matthias Gehre <gehre.matthias@gmail.com> | 2019-09-22 23:19:41 +0200 |
---|---|---|
committer | Matthias Gehre <gehre.matthias@gmail.com> | 2019-11-06 09:27:02 +0100 |
commit | 24130d661ed42c30f009b695d3c9ce57d2208b5e (patch) | |
tree | ef198d4aeec67df10b1e84c682db274940e8fe59 /clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp | |
parent | 092452d402d793c731c3861ba920a85c5c4e1fff (diff) | |
download | llvm-24130d661ed42c30f009b695d3c9ce57d2208b5e.zip llvm-24130d661ed42c30f009b695d3c9ce57d2208b5e.tar.gz llvm-24130d661ed42c30f009b695d3c9ce57d2208b5e.tar.bz2 |
[clang-tidy] Add readability-make-member-function-const
Summary:
Finds non-static member functions that can be made ``const``
because the functions don't use ``this`` in a non-const way.
The check conservatively tries to preserve logical costness in favor of
physical costness. See readability-make-member-function-const.rst for more
details.
Reviewers: aaron.ballman, gribozavr, hokein, alexfh
Subscribers: mgorny, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68074
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp index 2fd2870..d8b1c25 100644 --- a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp @@ -23,6 +23,7 @@ #include "InconsistentDeclarationParameterNameCheck.h" #include "IsolateDeclarationCheck.h" #include "MagicNumbersCheck.h" +#include "MakeMemberFunctionConstCheck.h" #include "MisleadingIndentationCheck.h" #include "MisplacedArrayIndexCheck.h" #include "NamedParameterCheck.h" @@ -79,6 +80,8 @@ public: "readability-isolate-declaration"); CheckFactories.registerCheck<MagicNumbersCheck>( "readability-magic-numbers"); + CheckFactories.registerCheck<MakeMemberFunctionConstCheck>( + "readability-make-member-function-const"); CheckFactories.registerCheck<MisleadingIndentationCheck>( "readability-misleading-indentation"); CheckFactories.registerCheck<MisplacedArrayIndexCheck>( |