diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-01-16 08:29:54 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-01-16 08:29:54 +0000 |
commit | 5a8e6afff2f334cb38e4b21e862d6c95c67aa8c8 (patch) | |
tree | f3066efafee300e5ac8ea16e3a88914af08d5c0d /clang-tools-extra | |
parent | [clangd] Fix XPC after rCTE351280 (diff) | |
download | llvm-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.cpp | 2 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-tidy/fuchsia-overloaded-operator.cpp | 2 |
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 = []{}; |