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

Jussi Pakkanen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 15:04:36 PDT 2019


jpakkane created this revision.
jpakkane added a reviewer: alexfh.
Herald added subscribers: cfe-commits, mgorny.
Herald added a project: clang.

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.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D64671

Files:
  clang-tools-extra/clang-tidy/misc/CMakeLists.txt
  clang-tools-extra/clang-tidy/misc/InitLocalVariablesCheck.cpp
  clang-tools-extra/clang-tidy/misc/InitLocalVariablesCheck.h
  clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/misc-init-local-variables.rst
  clang-tools-extra/test/clang-tidy/misc-init-local-variables.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64671.209609.patch
Type: text/x-patch
Size: 9841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190712/dbf67734/attachment.bin>


More information about the cfe-commits mailing list