diff options
author | Felix Berger <flx@google.com> | 2016-02-15 04:27:56 +0000 |
---|---|---|
committer | Felix Berger <flx@google.com> | 2016-02-15 04:27:56 +0000 |
commit | ffae543b39ca51bf0108593689e143a50aea9087 (patch) | |
tree | 17fe1343ca0126684bdf2be939bcd6289058b9eb /clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp | |
parent | cc9df3b9cc5f8c8671c91775ba7f3c410650f72c (diff) | |
download | bcm5719-llvm-ffae543b39ca51bf0108593689e143a50aea9087.tar.gz bcm5719-llvm-ffae543b39ca51bf0108593689e143a50aea9087.zip |
[clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.
Summary:
This patch is a continuation of http://reviews.llvm.org/D10553 by Jonathan B Coe.
The main additions are:
1. For C++11 the check suggests in-class field initialization as fix. This
makes the fields future proof towards the addition of new constructors.
2 For older language versions the fields are added in the right position
in the initializer list with more tests.
3. User documentation.
Reviewers: alexfh, jbcoe
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16517
llvm-svn: 260873
Diffstat (limited to 'clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp index db783a3975d..70fa0f493a5 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp @@ -16,6 +16,7 @@ #include "ProBoundsPointerArithmeticCheck.h" #include "ProTypeConstCastCheck.h" #include "ProTypeCstyleCastCheck.h" +#include "ProTypeMemberInitCheck.h" #include "ProTypeReinterpretCastCheck.h" #include "ProTypeStaticCastDowncastCheck.h" #include "ProTypeUnionAccessCheck.h" @@ -39,6 +40,8 @@ public: "cppcoreguidelines-pro-type-const-cast"); CheckFactories.registerCheck<ProTypeCstyleCastCheck>( "cppcoreguidelines-pro-type-cstyle-cast"); + CheckFactories.registerCheck<ProTypeMemberInitCheck>( + "cppcoreguidelines-pro-type-member-init"); CheckFactories.registerCheck<ProTypeReinterpretCastCheck>( "cppcoreguidelines-pro-type-reinterpret-cast"); CheckFactories.registerCheck<ProTypeStaticCastDowncastCheck>( |