1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "OverrideBaseCallUsageChecker.h"
6 #include "CustomMatchers.h"
8 void OverrideBaseCallUsageChecker::registerMatchers(MatchFinder
*AstMatcher
) {
9 AstMatcher
->addMatcher(
10 cxxMethodDecl(isNonVirtual(), isRequiredBaseMethod()).bind("method"),
14 void OverrideBaseCallUsageChecker::check(
15 const MatchFinder::MatchResult
&Result
) {
17 "MOZ_REQUIRED_BASE_METHOD can be used only on virtual methods";
18 const CXXMethodDecl
*Method
= Result
.Nodes
.getNodeAs
<CXXMethodDecl
>("method");
20 diag(Method
->getLocation(), Error
, DiagnosticIDs::Error
);