Prazek updated this revision to Diff 59561. Prazek marked an inline comment as done. Prazek added a comment.
Fixed stuff http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/UseEmplaceCheck.cpp docs/ReleaseNotes.rst docs/clang-tidy/checks/modernize-use-emplace.rst Index: docs/clang-tidy/checks/modernize-use-emplace.rst =================================================================== --- docs/clang-tidy/checks/modernize-use-emplace.rst +++ docs/clang-tidy/checks/modernize-use-emplace.rst @@ -3,9 +3,8 @@ modernize-use-emplace ===================== -This check would look for cases when inserting new element into an STL -container, but the element is constructed temporarily or is constructed just -to be moved. It would also work with std::pair. +This check look for cases when inserting new element into an STL +container, but the element is constructed temporarily. Before: Index: docs/ReleaseNotes.rst =================================================================== --- docs/ReleaseNotes.rst +++ docs/ReleaseNotes.rst @@ -209,7 +209,7 @@ - New `modernize-use-emplace <http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html>`_ check - Finds calls that could be change to emplace. + Finds calls that could be changed to emplace. - New `performance-faster-string-find <http://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html>`_ check Index: clang-tidy/modernize/UseEmplaceCheck.cpp =================================================================== --- clang-tidy/modernize/UseEmplaceCheck.cpp +++ clang-tidy/modernize/UseEmplaceCheck.cpp @@ -54,16 +54,16 @@ const auto *PushBackExpr = Result.Nodes.getNodeAs<MemberExpr>("push_back"); const auto *InnerCtorCall = Result.Nodes.getNodeAs<CXXConstructExpr>("ctor"); - auto functionNameSourceRange = CharSourceRange::getCharRange( + auto FunctionNameSourceRange = CharSourceRange::getCharRange( PushBackExpr->getExprLoc(), Call->getArg(0)->getExprLoc()); auto Diag = diag(PushBackExpr->getExprLoc(), "use emplace_back instead of push_back"); - if (functionNameSourceRange.getBegin().isMacroID()) + if (FunctionNameSourceRange.getBegin().isMacroID()) return; - Diag << FixItHint::CreateReplacement(functionNameSourceRange, + Diag << FixItHint::CreateReplacement(FunctionNameSourceRange, "emplace_back("); auto CallParensRange = InnerCtorCall->getParenOrBraceRange();
Index: docs/clang-tidy/checks/modernize-use-emplace.rst =================================================================== --- docs/clang-tidy/checks/modernize-use-emplace.rst +++ docs/clang-tidy/checks/modernize-use-emplace.rst @@ -3,9 +3,8 @@ modernize-use-emplace ===================== -This check would look for cases when inserting new element into an STL -container, but the element is constructed temporarily or is constructed just -to be moved. It would also work with std::pair. +This check look for cases when inserting new element into an STL +container, but the element is constructed temporarily. Before: Index: docs/ReleaseNotes.rst =================================================================== --- docs/ReleaseNotes.rst +++ docs/ReleaseNotes.rst @@ -209,7 +209,7 @@ - New `modernize-use-emplace <http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html>`_ check - Finds calls that could be change to emplace. + Finds calls that could be changed to emplace. - New `performance-faster-string-find <http://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html>`_ check Index: clang-tidy/modernize/UseEmplaceCheck.cpp =================================================================== --- clang-tidy/modernize/UseEmplaceCheck.cpp +++ clang-tidy/modernize/UseEmplaceCheck.cpp @@ -54,16 +54,16 @@ const auto *PushBackExpr = Result.Nodes.getNodeAs<MemberExpr>("push_back"); const auto *InnerCtorCall = Result.Nodes.getNodeAs<CXXConstructExpr>("ctor"); - auto functionNameSourceRange = CharSourceRange::getCharRange( + auto FunctionNameSourceRange = CharSourceRange::getCharRange( PushBackExpr->getExprLoc(), Call->getArg(0)->getExprLoc()); auto Diag = diag(PushBackExpr->getExprLoc(), "use emplace_back instead of push_back"); - if (functionNameSourceRange.getBegin().isMacroID()) + if (FunctionNameSourceRange.getBegin().isMacroID()) return; - Diag << FixItHint::CreateReplacement(functionNameSourceRange, + Diag << FixItHint::CreateReplacement(FunctionNameSourceRange, "emplace_back("); auto CallParensRange = InnerCtorCall->getParenOrBraceRange();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits