[PATCH] D22208: clang-tidy] Fixes to modernize-use-emplace

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 22:27:01 PDT 2016


Prazek marked 5 inline comments as done.
Prazek added a comment.

Aaron, Alex thanks for the review. After running it on llvm I also have found the private constructor bug so I also fixed it.


================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:21
@@ +20,3 @@
+llvm::Optional<ast_matchers::internal::Matcher<NamedDecl>>
+getHasAnyName(const std::vector<std::string> &Names) {
+  llvm::Optional<ast_matchers::internal::Matcher<NamedDecl>> HasNameMatcher;
----------------
aaron.ballman wrote:
> Looking at `VariadicFunction`, it appears that it already works if you pass an `ArrayRef<T>` to the `operator()()` overload. See ASTMatchersInternal.h:81. So I still think the matcher can be used directly, just with changing the type of the object passed to the functor.
That's cool! I convert the vector to SmallVector, because ArrayRef doesn't have ctor taking iterators.

I will later also change the code in FasterStringFind that also do this kind of things.


Repository:
  rL LLVM

https://reviews.llvm.org/D22208





More information about the cfe-commits mailing list