sbarzowski added inline comments.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:30
@@ +29,3 @@
+      cxxMemberCallExpr(hasDeclaration(functionDecl(hasName(PushBackName))),
+                        on(hasType(cxxRecordDecl(hasName(VectorName)))))
+          .bind("call");
----------------
Maybe it can work with some more types, with minimal changes... Like maybe 
std::list.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:38
@@ +37,3 @@
+  auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl(
+      ofClass(hasAnyName("std::shared_ptr", "std::unique_ptr", "std::auto_ptr",
+                         "std::weak_ptr"))));
----------------
This argument really holds for _any_ class taking ownership of the created 
object.

Maybe it would be better to check if we pass a non-const pointer as an argument 
to the constructor, as a pretty good indicator of taking ownership.

Or maybe just look for `new` operator in the expression.


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