Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repair various issues with modernize-avoid-bind
In the process of running this check on a large codebase I found a number of limitations, and thought I would pass on my fixes for possible integration upstream: * Templated function call operators are not supported * Function object constructors are always used directly in the lambda body, even if their arguments are not captured * Placeholders with namespace qualifiers (std::placeholders::_1) are not detected * Lambda arguments should be forwarded to the stored function * Data members from other classes still get captured with this * Expressions (as opposed to variables) inside std::ref are not captured properly * Function object templates sometimes have their template arguments replaced with concrete types This patch resolves all those issues and adds suitable unit tests.
- Loading branch information
1 parent
c95ffad
commit 95a3550
Showing
3 changed files
with
154 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.