10 #include "clang/AST/ASTContext.h" 11 #include "clang/ASTMatchers/ASTMatchFinder.h" 19 void DefaultArgumentsCheck::registerMatchers(MatchFinder *Finder) {
21 cxxMethodDecl(anyOf(isOverride(), isVirtual()),
22 hasAnyParameter(parmVarDecl(hasInitializer(expr()))))
27 void DefaultArgumentsCheck::check(
const MatchFinder::MatchResult &
Result) {
28 const auto *MatchedDecl = Result.Nodes.getNodeAs<CXXMethodDecl>(
"Decl");
29 diag(MatchedDecl->getLocation(),
30 "default arguments on virtual or override methods are prohibited");
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result