HomePhabricator

[clang-tidy] performance-unnecessary-copy-initialization: Directly examine the…

Authored by flx on May 24 2021, 6:45 AM.

Description

[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