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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 06:20:31 PDT 2016


aaron.ballman added inline comments.

================
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;
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D22208





More information about the cfe-commits mailing list