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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 11:37:22 PDT 2020


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();
+}
----------------
Can you add one more test case to be sure we really only care about The `std::function` and not some pathological code like:
```
namespace clever {
namespace std {
template <class R, class... Args>
class function {}; // clever::std::function is not ::std::function
}
}
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89332/new/

https://reviews.llvm.org/D89332



More information about the cfe-commits mailing list