[all-commits] [llvm/llvm-project] bdd5da: [clang-tidy] performance-unnecessary-copy-initiali...

Felix Berger via All-commits all-commits at lists.llvm.org
Fri Jun 18 12:27:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bdd5da9dec61072f693726d9ed2a94c78e431ba2
      https://github.com/llvm/llvm-project/commit/bdd5da9dec61072f693726d9ed2a94c78e431ba2
  Author: Felix Berger <flx at google.com>
  Date:   2021-06-18 (Fri, 18 Jun 2021)

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

  Log Message:
  -----------
  [clang-tidy] performance-unnecessary-copy-initialization: Directly examine the initializing var's initializer.

This fixes false positive cases where a reference is initialized outside of a
block statement and then its initializing variable is modified. Another case is
when the looped over container is modified.

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

Reviewed-by: ymandel




More information about the All-commits mailing list