[Clang-Tidy]: modernize-avoid-bind erroneous scope resolution.
Idriss RIOUAK via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 6 01:03:36 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/20161006/7f9b1103/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/20161006/7f9b1103/attachment-0002.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161006/7f9b1103/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/20161006/7f9b1103/attachment-0003.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161006/7f9b1103/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/20161006/7f9b1103/attachment-0001.bin>
More information about the cfe-commits
mailing list