Skip to content
Commit 671ad580 authored by Felix Berger's avatar Felix Berger
Browse files

[clang-tidy] performance-unnecessary-copy-initialization: Prevent false...

[clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

Extend the check to not only look at the variable the unnecessarily copied
variable is initialized from, but also ensure that any variable the old variable
references is not modified.

Extend DeclRefExprUtils to also count references and pointers to const assigned
from the DeclRef we check for const usages.

Reviewed-by: aaron.ballman

Differential Revision: https://reviews.llvm.org/D91893
parent 0978c83e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment