[Clang-tools-extra][Clang-Tidy]: Fix modernize-avoid-bind erroneous scope resolution. [ping]

Idriss RIOUAK via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 13 05:23:42 PDT 2016


Hello, i would like to suggest a fix for one of the checks in clang-tidy and i should hope this one is the correct mailing list.
The check is modernize-avoid-bind.

Consider the following:

void bar(int x, int y);

namespace N{
  void bar(int x, int y);
}

void foo(){
  auto Test = std::bind(N::bar,1,1);
}

clang-tidy’s modernize-avoid-bind check suggests writing:

void foo(){
  auto Test =[] {return bar(1,1);};
}

instead of:

void foo(){
  auto Test = [] {return N::bar(1,1);};
}

So clang-tidy has proposed an incorrect Fix.

This is my proposal patch:


And this is my proposal testcase:


Should I have to open a report on BugZilla?

Idriss Riouak
idriss.riouak at studenti.unipr.it <mailto:idriss.riouak at studenti.unipr.it>
Corso di Laurea in scienze informatica.
Dipartimento di Matematica e Informatica.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7116b4c8/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AvoidBindCheck.patch
Type: application/octet-stream
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7116b4c8/attachment-0002.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7116b4c8/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modernize-avoid-bind.patch
Type: application/octet-stream
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7116b4c8/attachment-0003.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7116b4c8/attachment-0005.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7116b4c8/attachment-0001.bin>


More information about the cfe-commits mailing list