17 Finder->addMatcher(cxxDefaultArgExpr().bind(
"stmt"),
this);
21 const auto *S = Result.Nodes.getNodeAs<CXXDefaultArgExpr>(
"stmt");
25 diag(S->getUsedLocation(),
26 "calling a function that uses a default argument is disallowed");
27 diag(S->getParam()->getBeginLoc(),
"default parameter was declared here",
DiagnosticBuilder diag(SourceLocation Loc, StringRef Description, DiagnosticIDs::Level Level=DiagnosticIDs::Warning)
Add a diagnostic with the check's name.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.