diff options
author | Alexander Kornienko <alexfh@google.com> | 2017-06-02 17:36:32 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2017-06-02 17:36:32 +0000 |
commit | d9a4491b0a05a70733a80622d29a49d79210622a (patch) | |
tree | f4cb0a552e8a0096874142cf045bc67ee1bf07cb /clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | |
parent | cdb5dad4cc4039e357c0437d9789b0353a989565 (diff) | |
download | llvm-d9a4491b0a05a70733a80622d29a49d79210622a.zip llvm-d9a4491b0a05a70733a80622d29a49d79210622a.tar.gz llvm-d9a4491b0a05a70733a80622d29a49d79210622a.tar.bz2 |
[clang-tidy] check for __func__/__FUNCTION__ in lambdas
Add a clang-tidy check for using func__/FUNCTION__ inside lambdas. This
evaluates to the string operator(), which is almost never useful and almost
certainly not what the author intended.
Patch by Bryce Liu!
Differential Revision: https://reviews.llvm.org/D33497
llvm-svn: 304570
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index 43d09c7..5448c04 100644 --- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp @@ -21,6 +21,7 @@ #include "InaccurateEraseCheck.h" #include "IncorrectRoundings.h" #include "InefficientAlgorithmCheck.h" +#include "LambdaFunctionNameCheck.h" #include "MacroParenthesesCheck.h" #include "MacroRepeatedSideEffectsCheck.h" #include "MisplacedConstCheck.h" @@ -68,6 +69,8 @@ public: "misc-assert-side-effect"); CheckFactories.registerCheck<ForwardingReferenceOverloadCheck>( "misc-forwarding-reference-overload"); + CheckFactories.registerCheck<LambdaFunctionNameCheck>( + "misc-lambda-function-name"); CheckFactories.registerCheck<MisplacedConstCheck>("misc-misplaced-const"); CheckFactories.registerCheck<UnconventionalAssignOperatorCheck>( "misc-unconventional-assign-operator"); |