Add the misc-init-local-variables check.
authorAaron Ballman <aaron@aaronballman.com>
Wed, 2 Oct 2019 17:18:57 +0000 (17:18 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 2 Oct 2019 17:18:57 +0000 (17:18 +0000)
commitb879fd05bd7628cfb27d8e127dc8751389dcd1d7
tree7ee81f7e1c5ba7aaa03d83f3972a2f0b6974e792
parenteb6700b57e969e75014394a02e8130542f3f6457
Add the misc-init-local-variables check.

This checks finds all primitive type local variables (integers, doubles, pointers) that are declared without an initial value. Includes fixit functionality to initialize said variables with a default value. This is zero for most types and NaN for floating point types. The use of NaNs is copied from the D programming language.

Patch by Jussi Pakkanen.

llvm-svn: 373489
clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/cppcoreguidelines-init-variables.cpp [new file with mode: 0644]