File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -40,18 +40,13 @@ void SpecialMemberFunctionsCheck::storeOptions(
40
40
void SpecialMemberFunctionsCheck::registerMatchers (MatchFinder *Finder) {
41
41
Finder->addMatcher (
42
42
cxxRecordDecl (
43
- eachOf (
44
- has (cxxDestructorDecl (unless (isImplicit ())).bind (" dtor" )),
45
- has (cxxConstructorDecl (isCopyConstructor (), unless (isImplicit ()))
46
- .bind (" copy-ctor" )),
47
- has (cxxMethodDecl (isCopyAssignmentOperator (),
48
- unless (isImplicit ()))
49
- .bind (" copy-assign" )),
50
- has (cxxConstructorDecl (isMoveConstructor (), unless (isImplicit ()))
51
- .bind (" move-ctor" )),
52
- has (cxxMethodDecl (isMoveAssignmentOperator (),
53
- unless (isImplicit ()))
54
- .bind (" move-assign" ))))
43
+ eachOf (has (cxxDestructorDecl ().bind (" dtor" )),
44
+ has (cxxConstructorDecl (isCopyConstructor ()).bind (" copy-ctor" )),
45
+ has (cxxMethodDecl (isCopyAssignmentOperator ())
46
+ .bind (" copy-assign" )),
47
+ has (cxxConstructorDecl (isMoveConstructor ()).bind (" move-ctor" )),
48
+ has (cxxMethodDecl (isMoveAssignmentOperator ())
49
+ .bind (" move-assign" ))))
55
50
.bind (" class-def" ),
56
51
this );
57
52
}
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ class SpecialMemberFunctionsCheck : public ClangTidyCheck {
32
32
void registerMatchers (ast_matchers::MatchFinder *Finder) override ;
33
33
void check (const ast_matchers::MatchFinder::MatchResult &Result) override ;
34
34
void onEndOfTranslationUnit () override ;
35
-
35
+ llvm::Optional<TraversalKind> getCheckTraversalKind () const override {
36
+ return TK_IgnoreUnlessSpelledInSource;
37
+ }
36
38
enum class SpecialMemberFunctionKind : uint8_t {
37
39
Destructor,
38
40
DefaultDestructor,
You can’t perform that action at this time.
0 commit comments