[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1c1f794c2b64: Always allow std::function to be copied. (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
flx marked an inline comment as done. flx added a comment. Added a fake std function that still triggers the check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 __

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 299794. flx added a comment. Add fake std function to ensure it is still matched. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-tidy/perf

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM with an extra testing request (that should hopefully just work for you). Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:445 + int i = Orig(); +} -

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 299684. flx added a comment. Fix compile errors. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializa

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-20 Thread Felix Berger via Phabricator via cfe-commits
flx marked 2 inline comments as done. flx added a comment. Thank you all for the input! In D89332#2336566 , @njames93 wrote: > How does this type alias and typedef, In theory that should also be handled. > > using Functor = std::function<...>; > Funct

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-20 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 299471. flx added a comment. Use hasName matcher on the declaration of the canonical type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D89332#2338319 , @njames93 wrote: > Come to think of it, this is a pretty illogical way to solve this problem, > just append `::std::function` to the AllowedTypes vector in > `registerMatchers` and be do with it. Will re

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-19 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Come to think of it, this is a pretty illogical way to solve this problem, just append `::std::function` to the AllowedTypes vector in `registerMatchers` and be do with it. Will require dropping the const Qualifier on AllowedTypes, but aside from that it is a much simp

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-17 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:409 + +namespace std { + gribozavr2 wrote: > flx wrote: > > gribozavr2 wrote: > > > Could you add a nested inline namespace to

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-16 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:409 + +namespace std { + flx wrote: > gribozavr2 wrote: > > Could you add a nested inline namespace to better imitate what de

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-16 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. How does this type alias and typedef, In theory that should also be handled. using Functor = std::function<...>; Functor Copy = Orig; // No warning. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:39-44 +AST

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-16 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:52 AllowedTypes( utils::options::parseStringList(Options.get("AllowedTypes", ""))) {} lebedev.ri wrote: > flx wrote: > > lebedev

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-16 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 298745. flx added a comment. Add more complete fake version of std::function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-tidy/performa

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:52 AllowedTypes( utils::options::parseStringList(Options.get("AllowedTypes", ""))) {} flx wrote: > lebedev.ri wrote: > >

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-15 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:409 + +namespace std { + Could you add a

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-13 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:52 AllowedTypes( utils::options::parseStringList(Options.get("AllowedTypes", ""))) {} lebedev.ri wrote: > Just put it here? I tr

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:52 AllowedTypes( utils::options::parseStringList(Options.get("AllowedTypes", ""))) {} Just put it here? Repository: r