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

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 8 07:20:19 PDT 2018


JonasToth added a comment.

Is the type important, or specifics about the variable (e.g. the name?)
The `_` variable names are sometimes used for RAII variables/lambdas
that shall just do some cleanup, e.g. gsl::finally().

It might make sense to give `ExprMutAnalyzer` an ignore-mechanism.

I wonder if instead there should be an option to not complain about the variables that aren't actually used?

Checking for variable usage would be simple. The `ExprMutAnalyzer`
always analyses the scope, e.g. a function. You can match this scope for
a `DeclRefExpr` of the variable, empty result means no usage.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50447





More information about the cfe-commits mailing list