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