[PATCH] D45679: [clang-tidy] Add a new check, readability-unmodified-non-const-variable, that finds declarations of non-const variables that never get modified.

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 16 04:32:05 PDT 2018


JonasToth added a comment.

Hi @shuaiwang, i am currently working on the same check and we should definilty coordinate our work. :)

What do you think about joining the forces and to work together on such a check?

Things i would like to mention:

- i differentiate between values and handles. I want to be able to transform to `const int * const`  if possible, similar for references
- i believe you do not test on all occasion, a variable can not be const, e.g. if it is casted, if it is catched by a lambda, array access, access through member functions and object members

Did you run the check over a codebase like llvm yet and what did you find?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45679





More information about the cfe-commits mailing list