diff options
| author | Zachary Turner <zturner@roblox.com> | 2019-11-20 11:27:14 -0800 |
|---|---|---|
| committer | Zachary Turner <zturner@roblox.com> | 2019-12-02 15:36:26 -0800 |
| commit | 64f74bf72eb484aa32e1104050cb54745116decf (patch) | |
| tree | 16787356f6c7c67b23b603098880a12eb55fca28 /clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h | |
| parent | 87f146767ed709f6e354fe46f325c5b6848ad428 (diff) | |
| download | bcm5719-llvm-64f74bf72eb484aa32e1104050cb54745116decf.tar.gz bcm5719-llvm-64f74bf72eb484aa32e1104050cb54745116decf.zip | |
[clang-tidy] Rewrite modernize-avoid-bind check.
This represents largely a full re-write of modernize-avoid-bind, adding
significant new functionality in the process. In particular:
* Both boost::bind and std::bind are now supported
* Function objects are supported in addition to functions
* Member functions are supported
* Nested calls are supported using capture-init syntax
* std::ref() and boost::ref() are now recognized, and will capture by reference.
* Rather than capturing with a global =, we now build up an individual
capture list that is both necessary and sufficient for the call.
* Fixits are supported in a much larger variety of scenarios than before.
All previous tests pass under the re-write, but a large number of new
tests have been added as well.
Differential Revision: https://reviews.llvm.org/D70368
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h')
| -rw-r--r-- | clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h index 4b393303b7e..5576fe6c3bd 100644 --- a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h @@ -23,10 +23,12 @@ namespace modernize { /// http://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-std-bind.html class AvoidBindCheck : public ClangTidyCheck { public: - AvoidBindCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} + AvoidBindCheck(StringRef Name, ClangTidyContext *Context); void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; + +private: + bool PermissiveParameterList = false; }; } // namespace modernize } // namespace tidy |

