19 AST_MATCHER(FunctionDecl, isFuchsiaOverloadedOperator) {
20 if (
const auto *CXXMethodNode = dyn_cast<CXXMethodDecl>(&Node)) {
21 if (CXXMethodNode->isCopyAssignmentOperator() ||
22 CXXMethodNode->isMoveAssignmentOperator())
24 if (CXXMethodNode->getParent()->isLambda())
27 return Node.isOverloadedOperator();
31 void OverloadedOperatorCheck::registerMatchers(MatchFinder *Finder) {
32 Finder->addMatcher(functionDecl(isFuchsiaOverloadedOperator()).bind(
"decl"),
36 void OverloadedOperatorCheck::check(
const MatchFinder::MatchResult &
Result) {
37 const auto *
D = Result.Nodes.getNodeAs<FunctionDecl>(
"decl");
38 assert(
D &&
"No FunctionDecl captured!");
40 SourceLocation
Loc =
D->getBeginLoc();
42 diag(Loc,
"overloading %0 is disallowed") <<
D;
SourceLocation Loc
'#' location in the include directive
AST_MATCHER(BinaryOperator, isAssignmentOperator)
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//