https://github.com/PiotrZSL created
https://github.com/llvm/llvm-project/pull/77246
Implement proper support for lambdas and sub-functions/classes.
Moved from https://reviews.llvm.org/D157285
Fixes: #59389
>From b2e230f90f97c0fb3385ab05d0217371b72b9a88 Mon Sep 17 00:00:00 2001
From: Piotr Zega
llvmbot wrote:
@llvm/pr-subscribers-clang-tidy
Author: Piotr Zegar (PiotrZSL)
Changes
Implement proper support for lambdas and sub-functions/classes.
Moved from https://reviews.llvm.org/D157285
Fixes: #59389
---
Full diff: https://github.com/llvm/llvm-project/pull/77246.diff
3 Files Af
@@ -147,10 +161,51 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti requested changes to this pull request.
I had an idea for the added matchers that improves their readability.
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
@@ -19,6 +19,18 @@ using namespace clang::ast_matchers::internal;
namespace clang::tidy::cppcoreguidelines {
+namespace {
+AST_MATCHER_P(LambdaExpr, hasCallOperator,
+ ast_matchers::internal::Matcher, InnerMatcher) {
+ return InnerMatcher.matches(*Node.getCallOp
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -147,10 +161,51 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
https://github.com/PiotrZSL updated
https://github.com/llvm/llvm-project/pull/77246
>From f7534c0d9ce6d2c8ce8a075a36a801549287edb9 Mon Sep 17 00:00:00 2001
From: Piotr Zegar
Date: Sun, 7 Jan 2024 18:52:05 +
Subject: [PATCH 1/5] [clang-tidy] Add support for lambdas in
cppcoreguidelines-owni
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
5chmidti wrote:
But wait for @HerrCai0907, you commented earlier as well.
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HerrCai0907 approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
https://github.com/5chmidti commented:
I only have two nits
https://github.com/llvm/llvm-project/pull/77246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder
*Finder) {
// Matching on functions, that return an owner/resource, but don't declare
// their return type as owner.
Finder->addMatcher(
- functionDecl(hasDescendant(returnStmt(hasReturnValue
https://github.com/PiotrZSL updated
https://github.com/llvm/llvm-project/pull/77246
>From b2e230f90f97c0fb3385ab05d0217371b72b9a88 Mon Sep 17 00:00:00 2001
From: Piotr Zegar
Date: Sun, 7 Jan 2024 18:52:05 +
Subject: [PATCH 1/2] [clang-tidy] Add support for lambdas in
cppcoreguidelines-owni
23 matches
Mail list logo