[clang-tools-extra] r351307 - [clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after r351047
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 16 00:29:54 PST 2019
Author: sammccall
Date: Wed Jan 16 00:29:54 2019
New Revision: 351307
URL: http://llvm.org/viewvc/llvm-project?rev=351307&view=rev
Log:
[clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after r351047
Modified:
clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/fuchsia-overloaded-operator.cpp
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp?rev=351307&r1=351306&r2=351307&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp Wed Jan 16 00:29:54 2019
@@ -21,6 +21,8 @@ AST_MATCHER(FunctionDecl, isFuchsiaOverl
if (CXXMethodNode->isCopyAssignmentOperator() ||
CXXMethodNode->isMoveAssignmentOperator())
return false;
+ if (CXXMethodNode->getParent()->isLambda())
+ return false;
}
return Node.isOverloadedOperator();
}
Modified: clang-tools-extra/trunk/test/clang-tidy/fuchsia-overloaded-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/fuchsia-overloaded-operator.cpp?rev=351307&r1=351306&r2=351307&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/fuchsia-overloaded-operator.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/fuchsia-overloaded-operator.cpp Wed Jan 16 00:29:54 2019
@@ -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 = []{};
More information about the cfe-commits
mailing list