[PATCH] D50447: [clang-tidy] Add a whitelistClasses option in performance-for-range-copy check.

Shuai Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 8 22:03:18 PDT 2018


shuaiwang added a comment.

In https://reviews.llvm.org/D50447#1192393, @JonasToth wrote:

> ... just check if the variable is dereferenced in the scope of the loop (any
>  declRefExpr exists).


+1
And I would imagine it's very rare (as in categories not raw number of occurrences) for a loop variable to be not used in the loop body so it's probably a safe change. Though I'm interested to learn whether there's any real false negative by doing this.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50447





More information about the cfe-commits mailing list