aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-01-16 08:29:54 +0000
committerSam McCall <sam.mccall@gmail.com>2019-01-16 08:29:54 +0000
commit5a8e6afff2f334cb38e4b21e862d6c95c67aa8c8 (patch)
treef3066efafee300e5ac8ea16e3a88914af08d5c0d /clang-tools-extra
parent[clangd] Fix XPC after rCTE351280 (diff)
downloadllvm-project-5a8e6afff2f334cb38e4b21e862d6c95c67aa8c8.tar.gz
llvm-project-5a8e6afff2f334cb38e4b21e862d6c95c67aa8c8.tar.bz2
llvm-project-5a8e6afff2f334cb38e4b21e862d6c95c67aa8c8.zip
[clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after r351047
llvm-svn: 351307
Diffstat (limited to 'clang-tools-extra')
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp2
-rw-r--r--clang-tools-extra/test/clang-tidy/fuchsia-overloaded-operator.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
index 8e6c74f322ef..4aab1e01d48f 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
@@ -21,6 +21,8 @@ AST_MATCHER(FunctionDecl, isFuchsiaOverloadedOperator) {
if (CXXMethodNode->isCopyAssignmentOperator() ||
CXXMethodNode->isMoveAssignmentOperator())
return false;
+ if (CXXMethodNode->getParent()->isLambda())
+ return false;
}
return Node.isOverloadedOperator();
}
diff --git a/clang-tools-extra/test/clang-tidy/fuchsia-overloaded-operator.cpp b/clang-tools-extra/test/clang-tidy/fuchsia-overloaded-operator.cpp
index be65a329dc6f..7f7a36e8c98b 100644
--- a/clang-tools-extra/test/clang-tidy/fuchsia-overloaded-operator.cpp
+++ b/clang-tools-extra/test/clang-tidy/fuchsia-overloaded-operator.cpp
@@ -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 = []{};