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

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 15:38:12 PDT 2016


Prazek added inline comments.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.h:36-37
@@ -32,1 +35,4 @@
+private:
+  std::vector<std::string> ContainersWithPushBack;
+  std::vector<std::string> SmartPointers;
 };
----------------
aaron.ballman wrote:
> Why not use a SmallVector for these instead of a std::vector? Then you don't need to typecast in registerMatchers().
> 
> If it's because of parseStringList(), I think that you can work around it's tight coupling using llvm::iterator_range(parseStringList()) to perform the initialization in the ctor initializer list.
Unfortunatelly it doesn't want to work. I tried  llvm::iterator_range<std::string*> and  llvm::iterator_range<SmallVector<std::string, 5>::iterator> and it doesn't compile.


Repository:
  rL LLVM

https://reviews.llvm.org/D22208





More information about the cfe-commits mailing list