[all-commits] [llvm/llvm-project] 987f9c: [clang-tidy] Add proper emplace checks to moderniz...

Nicolas van Kempen via All-commits all-commits at lists.llvm.org
Thu Jun 2 16:15:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 987f9cb6b9708ff16980c4f8c3f8ba4674463fb5
      https://github.com/llvm/llvm-project/commit/987f9cb6b9708ff16980c4f8c3f8ba4674463fb5
  Author: Nicolas van Kempen <nvankempen at fb.com>
  Date:   2022-06-03 (Fri, 03 Jun 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h
    M clang-tools-extra/docs/clang-tidy/checks/modernize-use-emplace.rst
    M clang-tools-extra/test/clang-tidy/checkers/modernize-use-emplace.cpp

  Log Message:
  -----------
  [clang-tidy] Add proper emplace checks to modernize-use-emplace

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.

Reviewed By: kuhar, ivanmurashko

Differential Revision: https://reviews.llvm.org/D101471




More information about the All-commits mailing list