[PATCH] D70368: [clang-tidy] Rewrite modernize-avoid-bind check
Zachary Turner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 17 18:39:04 PST 2019
zturner created this revision.
zturner added reviewers: aaron.ballman, dblaikie, jbcoe, NoQ.
Herald added a subscriber: xazax.hun.
This represents largely a full re-write of modernize-avoid-bind, adding significant new functionality in the process. In particular:
1. Both boost::bind and std::bind are now supported
2. Function objects are supported in addition to functions
3. Member functions are supported
4. Nested calls are supported using capture-init syntax
5. `std::ref()` and `boost::ref()` are now recognized, and will capture by reference.
6. Rather than capturing with a global `=`, we now build up an individual capture list that is both necessary and sufficient for the call.
7. 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.
I don't know who the best person to review this is, so I've put a couple of people on here. Feel free to re-direct if there's someone better.
https://reviews.llvm.org/D70368
Files:
clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h
clang-tools-extra/test/clang-tidy/checkers/modernize-avoid-bind.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70368.229736.patch
Type: text/x-patch
Size: 37607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191118/a7aa935f/attachment-0001.bin>
More information about the cfe-commits
mailing list