[PATCH] D64671: [clang-tidy] New check: misc-init-local-variables

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 06:19:58 PDT 2019

JonasToth added a comment.

In D64671#1606084 <https://reviews.llvm.org/D64671#1606084>, @jpakkane wrote:

> In D64671#1603427 <https://reviews.llvm.org/D64671#1603427>, @alexfh wrote:
> > A general comment: "misc" is a sort of a heap of checks that otherwise don't have a good home. This one would probably better go to bugprone (or maybe there's a relevant CERT or C++ Core Guidelines rule?).
> The closest I could find is ES.20 "Always initialize an object": https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es20-always-initialize-an-object
> So a potential name for this could be "cppcoreguidelines-init-variables". However that rule is about initializing all variables, even those in structs and classes. This is about local variables.

I am in favor of something like `cppcoreguidelines-init-variables` that might catch other cases in the future as well. IMHO its fine to start with something partial, especially "just" local variables.



More information about the cfe-commits mailing list