Bug 1707681 - Ignore third party paths in explicit-operator-bool check r=andi

Differential Revision: https://phabricator.services.mozilla.com/D113695
This commit is contained in:
Kagami Sascha Rosylight 2021-05-04 06:20:25 +00:00
parent 0eb94679e5
commit 1b59a49ab1

View File

@ -6,11 +6,8 @@
#include "CustomMatchers.h"
void ExplicitOperatorBoolChecker::registerMatchers(MatchFinder *AstMatcher) {
// Older clang versions such as the ones used on the infra recognize these
// conversions as 'operator _Bool', but newer clang versions recognize these
// as 'operator bool'.
AstMatcher->addMatcher(
cxxMethodDecl(anyOf(hasName("operator bool"), hasName("operator _Bool")))
cxxMethodDecl(allOf(isFirstParty(), hasName("operator bool")))
.bind("node"),
this);
}