diff options
| author | Gabor Horvath <xazax.hun@gmail.com> | 2017-11-17 12:23:30 +0000 |
|---|---|---|
| committer | Gabor Horvath <xazax.hun@gmail.com> | 2017-11-17 12:23:30 +0000 |
| commit | d984e33b1e1ca2edec06461358ee071f5625b30e (patch) | |
| tree | c6bb265cf14ca59dfd1f042af062d1581eb4634e /clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp | |
| parent | 727157ea68c623d835d48209804831e4829a4f90 (diff) | |
| download | bcm5719-llvm-d984e33b1e1ca2edec06461358ee071f5625b30e.tar.gz bcm5719-llvm-d984e33b1e1ca2edec06461358ee071f5625b30e.zip | |
[clang-tidy] Add a check for undelegated copy of base classes
Finds copy constructors where the constructor don't call
the copy constructor of the base class.
```
class X : public Copyable {
X(const X &other) {} // Copyable(other) is missing
};
```
Differential Revision: https://reviews.llvm.org/D33722
llvm-svn: 318522
Diffstat (limited to 'clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp index c350c967245..5b89a9e69a9 100644 --- a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp @@ -10,6 +10,7 @@ #include "../ClangTidy.h" #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" +#include "CopyConstructorInitCheck.h" #include "IntegerDivisionCheck.h" #include "SuspiciousMemsetUsageCheck.h" #include "UndefinedMemoryManipulationCheck.h" @@ -21,6 +22,8 @@ namespace bugprone { class BugproneModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { + CheckFactories.registerCheck<CopyConstructorInitCheck>( + "misc-copy-constructor-init"); CheckFactories.registerCheck<IntegerDivisionCheck>( "bugprone-integer-division"); CheckFactories.registerCheck<SuspiciousMemsetUsageCheck>( |

