[PATCH] D101471: [clang-tidy] Add proper emplace checks to modernize-use-emplace

Nicolas van Kempen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 28 09:46:50 PDT 2021


nicovank created this revision.
nicovank added reviewers: alexfh, Prazek, kuhar.
nicovank added projects: clang, clang-tools-extra.
Herald added a subscriber: xazax.hun.
nicovank requested review of this revision.
Herald added a subscriber: cfe-commits.

modernize-use-emplace only recommends going from a push_back to an
emplace_back, but does not provide a recommendation when emplace_back is
improperly used. This adds the functionality of warning the user when
an unecessary temporary is created while calling emplace_back or other "emplacy"
functions from the STL containers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101471

Files:
  clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp
  clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h
  clang-tools-extra/test/clang-tidy/checkers/modernize-use-emplace.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101471.341247.patch
Type: text/x-patch
Size: 27777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210428/44757334/attachment-0001.bin>


More information about the cfe-commits mailing list