[clang-tools-extra] [clang-tidy] Add support for lambdas in cppcoreguidelines-owning-memory (PR #77246)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 11 09:48:38 PST 2024
================
@@ -19,6 +19,18 @@ using namespace clang::ast_matchers::internal;
namespace clang::tidy::cppcoreguidelines {
+namespace {
+AST_MATCHER_P(LambdaExpr, hasCallOperator,
+ ast_matchers::internal::Matcher<CXXMethodDecl>, InnerMatcher) {
+ return InnerMatcher.matches(*Node.getCallOperator(), Finder, Builder);
+}
+
+AST_MATCHER_P(LambdaExpr, hasLambdaBody, ast_matchers::internal::Matcher<Stmt>,
+ InnerMatcher) {
+ return InnerMatcher.matches(*Node.getBody(), Finder, Builder);
+}
----------------
5chmidti wrote:
You could drop `ast_matchers::internal` because of the using namespace.
https://github.com/llvm/llvm-project/pull/77246
More information about the cfe-commits
mailing list