[all-commits] [llvm/llvm-project] fc1b24: [clang-tidy]performance-unnecessary-copy-initializ...

Clement Courbet via All-commits all-commits at lists.llvm.org
Thu Oct 28 23:41:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc1b24d7360f59c8b89f1b6290fe849a6207dc44
      https://github.com/llvm/llvm-project/commit/fc1b24d7360f59c8b89f1b6290fe849a6207dc44
  Author: Clement Courbet <courbet at google.com>
  Date:   2021-10-29 (Fri, 29 Oct 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
    M clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp

  Log Message:
  -----------
  [clang-tidy]performance-unnecessary-copy-initialization: fix false negative

We're missing all cases where the return value is a type alias.

Unfortunately, this includes things we care about, such as
`std::vector<T>::operator[]` (return value is `const_reference`,
not `const T&`).

Match the canonical type instead.

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




More information about the All-commits mailing list