diff options
author | Jonathan Coe <jbcoe@me.com> | 2016-07-30 08:58:54 +0000 |
---|---|---|
committer | Jonathan Coe <jbcoe@me.com> | 2016-07-30 08:58:54 +0000 |
commit | 5d304b2456afba562855a692a5ea4d10cc5da9e7 (patch) | |
tree | 6714b10b6672049bfa6ec9d3a0676a886b092ec5 /clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp | |
parent | fcfec5fdef79cb4d96033aaabdb8286912d131ea (diff) | |
download | bcm5719-llvm-5d304b2456afba562855a692a5ea4d10cc5da9e7.tar.gz bcm5719-llvm-5d304b2456afba562855a692a5ea4d10cc5da9e7.zip |
[clang-tidy] add check cppcoreguidelines-special-member-functions
Summary:
Check for classes that violate the rule of five and zero as specified in CppCoreGuidelines:
"If a class defines or deletes a default operation then it should define or delete them all."
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all.
Reviewers: alexfh, sbenza, aaron.ballman
Subscribers: Prazek, Eugene.Zelenko, cfe-commits, ericLemanissier, nemanjai
Projects: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D22513
llvm-svn: 277262
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 608e2ee14a4..dc9a7f31dd5 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp @@ -22,6 +22,7 @@ #include "ProTypeStaticCastDowncastCheck.h" #include "ProTypeUnionAccessCheck.h" #include "ProTypeVarargCheck.h" +#include "SpecialMemberFunctionsCheck.h" #include "SlicingCheck.h" namespace clang { @@ -54,6 +55,8 @@ public: "cppcoreguidelines-pro-type-union-access"); CheckFactories.registerCheck<ProTypeVarargCheck>( "cppcoreguidelines-pro-type-vararg"); + CheckFactories.registerCheck<SpecialMemberFunctionsCheck>( + "cppcoreguidelines-special-member-functions"); CheckFactories.registerCheck<SlicingCheck>( "cppcoreguidelines-slicing"); CheckFactories.registerCheck<misc::UnconventionalAssignOperatorCheck>( |