vsk added inline comments.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:41
@@ +40,3 @@
+  // (and destructed) as in push_back case.
+  auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl(
+      ofClass(hasAnyName("std::shared_ptr", "std::unique_ptr", "std::auto_ptr",
----------------
I agree that blacklisting some smart pointers is not a complete solution, and 
that we shouldn't introduce a check which emits false positives.

ISTM it's **only** safe to perform the "push(T(...)) -> emplace(...)" change 
if: it's safe to assume that if "emplace(...)" does not successfully call 
"T(...)", it's OK for the program to fail/leak/crash. Do we get to make this 
assumption ever? Perhaps just in no-exceptions mode?


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