[PATCH] D45444: [clang-tidy] implement new check for const-correctness

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 6 14:10:02 PDT 2018


JonasToth added a comment.

In https://reviews.llvm.org/D45444#1189262, @aaron.ballman wrote:

> However, I'm wondering how this should integrate with other const-correctness efforts like `readability-non-const-parameter`?


I think this check/functionality will kinda replace the `readability-non-const-parameter` check. The readability check does not a full const-analysis too and i think only works on pointers or sth like this.
Maybe the check name will still exist, but use the `ExprMutAnalyzer` or it will become an alias to this with special configuration.
I would like to add support for marking methods `const` plus the ability for code transformation. Currently looking into `clang-refactor` framework to implement general refactoring primitives necessary for that.
In general its probably better to have one check, that handles all `const` issues.

> Also, I'm wondering how this check performs over a large code base like LLVM -- how chatty are the diagnostics, and how bad is the false positive rate (roughly)?

I will prepare a report for this tomorrow. Currently the LLVM builds take very long on my laptop :(


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45444





More information about the cfe-commits mailing list