[all-commits] [llvm/llvm-project] 64f74b: [clang-tidy] Rewrite modernize-avoid-bind check.

zjturner via All-commits all-commits at lists.llvm.org
Mon Dec 2 15:36:41 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 64f74bf72eb484aa32e1104050cb54745116decf
      https://github.com/llvm/llvm-project/commit/64f74bf72eb484aa32e1104050cb54745116decf
  Author: Zachary Turner <zturner at roblox.com>
  Date:   2019-12-02 (Mon, 02 Dec 2019)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst
    A clang-tools-extra/test/clang-tidy/checkers/modernize-avoid-bind-permissive-parameter-list.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize-avoid-bind.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list