[clang-tools-extra] [clang-tidy] Add new check 'misc-scope-reduction' (PR #175429)

Oliver Stöneberg via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 11 09:51:13 PST 2026


firewave wrote:

> From #22366, I think there is another option for the name of this check: misc-localizing-variables. But I'm neutral with these names.

As you could get "localization" from that it seems misleading. Scoping is what this is about.

> What about put this check in "readability" module instead of "misc"?

I think `misc` is appropriate as it changes the lifetime of variables. If this is ever extended to non-POD types without side effects it could also have impact on the generated code and `readability` should not affect that IMO.


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


More information about the cfe-commits mailing list