sbarzowski added inline comments.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:40
@@ +39,3 @@
+  // passed pointer because smart pointer won't be constructed
+  // (and destructed) as in push_back case.
+  auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl(
----------------
> Look at tests - the same thing happens when

Yeah. I meant looking for `new` in addition to blacklist.

> Not many custom classes take pointer in constructor. 

Obviously depends on codebase, but IMO it's quite common. However usually this 
classes aren't copy-constructible (or at least shouldn't be) anyway, making it 
impossible to use push_back, so maybe it's not such a big deal.

> If I will look for const pointers, then I will not be able to pass "abc" into 
> vector<string>.

I wrote explicitly about only **non**-const pointers.


http://reviews.llvm.org/D20964



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to