[clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after r351047

llvm-svn: 351307
This commit is contained in:
Sam McCall 2019-01-16 08:29:54 +00:00
parent 54762df8f6
commit 5a8e6afff2
2 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,8 @@ AST_MATCHER(FunctionDecl, isFuchsiaOverloadedOperator) {
if (CXXMethodNode->isCopyAssignmentOperator() ||
CXXMethodNode->isMoveAssignmentOperator())
return false;
if (CXXMethodNode->getParent()->isLambda())
return false;
}
return Node.isOverloadedOperator();
}

View File

@ -19,3 +19,5 @@ A operator-(const A &A1, const A &A2);
void operator delete(void*, void*) throw();
// CHECK-MESSAGES: [[@LINE-1]]:1: warning: overloading 'operator delete' is disallowed
auto x = []{};