[clang-tools-extra] [clang-tidy] make `misc-const-correctness` work with `auto` variables and lambdas (PR #157319)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 7 13:15:47 PDT 2025


localspook wrote:

Re: adding it under an option

I'm struggling to imagine a user that wants this change:
```diff
- int i = 10;
+ int const i = 10;
```
but *doesn't* want this change:
```diff
- auto i = 10;
+ auto const i = 10;
```
The way I see it, this PR is more of a bugfix rather than a new feature; it's bringing the check in line with what users already expect, and therefore doesn't need an option. What do you think?

https://github.com/llvm/llvm-project/pull/157319


More information about the cfe-commits mailing list