[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 5 10:12:16 PST 2020


JonasToth added a comment.

`clang/lib` almost transforms cleanly.
issues still left:

- `InitListExpr` can initialize non-const references. Such cases are not figured out yet (see `create_false_positive` at the end of the testcases)
- I found a case in clang, where `const` was correctly added to a variable, but that variable was used in a conditional operator (`foo ? const_var : non_const_var`) which broke compilation. I will not fix this, as this is extremly rare (I suppose) and in a sense defeats the purpose of our analysis. I think something like this should be fixed by hand with a `NOLINT`.

I continue to investigate false positives. But I think most of the real world problems are somewhat figured out now and i will start bringing the patch into better shape and might even split it up in `ExprMutAnalyzer` part and `clang-tidy` part.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54943/new/

https://reviews.llvm.org/D54943





More information about the cfe-commits mailing list