This patch improves the modernize-use-emplace check by adding support for
detecting inefficient invocations of the push and push_front methods on
STL-style containers and replacing them with their emplace-style equivalent.
Fixes #56996.
Paths
| Differential D131623
[clang-tidy] Improve modernize-use-emplace check ClosedPublic Authored by joeywatts on Aug 10 2022, 2:51 PM.
Details Summary This patch improves the modernize-use-emplace check by adding support for Fixes #56996.
Diff Detail
Event TimelineEugene.Zelenko retitled this revision from (wip) improve modernize-use-emplace check to [clang-tidy][wip] improve modernize-use-emplace check.Aug 10 2022, 10:19 PM joeywatts retitled this revision from [clang-tidy][wip] improve modernize-use-emplace check to [clang-tidy] Improve modernize-use-emplace check. Comment ActionsUpdated commit title/description. Comment Actions Just a general drive by comment here and doesn't affect this patch.
Comment Actions
I thought the same thing, but wasn't sure what the stance is on breaking changes here: would it be a problem if the existing "ContainersWithPush" option were removed in favor of a more generic option for a list of containers? EDIT: ah, I see you mean not specifying any list of containers at all and just detecting if the type has an equivalent emplace-style method. This revision is now accepted and ready to land.Aug 17 2022, 12:35 PM Comment Actions Thanks for the review @njames93! This is my first contribution so I don't think I have permission to land this myself, is there someone that can do that for me? Comment Actions
Sure, which email would you like me to use for the commit? Comment Actions
Please use jwatts43@bloomberg.net! Closed by commit rGb8655f7ff286: [clang-tidy] Improve modernize-use-emplace check (authored by joeywatts, committed by njames93). · Explain WhyAug 18 2022, 11:58 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 451960 clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h
clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/modernize/use-emplace.rst
clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace.cpp
|
clang-format not found in user’s local PATH; not linting file.