[PATCH] D20964: [clang-tidy] Add modernize-use-emplace

Stanisław Barzowski via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 3 08:02:38 PDT 2016


sbarzowski added inline comments.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:57
@@ +56,3 @@
+
+  auto functionNameSourceRange = CharSourceRange::getCharRange(
+      PushBackExpr->getExprLoc(), Call->getArg(0)->getExprLoc());
----------------
capital letter?

================
Comment at: docs/ReleaseNotes.rst:212
@@ +211,3 @@
+
+  Finds calls that could be change to emplace.
+
----------------
typo: change -> changed

================
Comment at: docs/clang-tidy/checks/modernize-use-emplace.rst:6
@@ +5,3 @@
+
+This check would look for cases when inserting new element into an STL
+container, but the element is constructed temporarily or is constructed just
----------------
Why "would"? Did you copy the description from the proposal? :-)

================
Comment at: docs/clang-tidy/checks/modernize-use-emplace.rst:8
@@ +7,3 @@
+container, but the element is constructed temporarily or is constructed just
+to be moved. It would also work with std::pair.
+
----------------
Same here, and it is not obvious to me what is so special about std::pair here.


http://reviews.llvm.org/D20964





More information about the cfe-commits mailing list