[clang-tools-extra] [clang-tidy][NFC] clean ReleaseNotes.rst (PR #130626)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/130626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support pointee mutation check in misc-const-correctness (PR #130494)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130494 >From 353f538f425ead9ee10ca6c046a6517b9e157db4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 9 Mar 2025 15:43:37 + Subject: [PATCH 1/4] [clang-tidy] support pointee mutation check in misc-const

[clang] [clang-tools-extra] [AstMatcher]`templateArgumentCountIs` support `FunctionDecl` (PR #130416)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130416 >From ca39210f6a28569116759f9e62b6120ddd746968 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 8 Mar 2025 21:22:47 +0800 Subject: [PATCH 1/5] [clang-tidy][NFC]refactor matcher for bugprone-optional-v

[clang] [AstMatcher][NFC]fix doc gen for ast matchers (PR #130726)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/130726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC]clean ConstCorrectnessCheck (PR #130493)

2025-03-11 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ### Merge activity * **Mar 11, 2:51 AM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/130493). https://github.com/llvm/llvm-project/pull/130493

[clang] [clang-tools-extra] [AstMatcher]`templateArgumentCountIs` support `FunctionDecl` (PR #130416)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130416 >From ca39210f6a28569116759f9e62b6120ddd746968 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 8 Mar 2025 21:22:47 +0800 Subject: [PATCH 1/4] [clang-tidy][NFC]refactor matcher for bugprone-optional-v

[clang-tools-extra] [clang-tidy] support pointee mutation check in misc-const-correctness (PR #130492)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/130492 None >From 87bda4d0f9c87512f42a600599dd65b80d8e7f60 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 9 Mar 2025 15:43:37 + Subject: [PATCH] [clang-tidy] support pointee mutation check in misc-con

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-03-11 Thread Congcong Cai via cfe-commits
Carlos =?utf-8?q?G=C3=A1lvez?= , Carlos =?utf-8?q?G=C3=A1lvez?= Message-ID: In-Reply-To: https://github.com/HerrCai0907 approved this pull request. lgtm. but i am not sure whether ignoring header will hurt static analyzer https://github.com/llvm/llvm-project/pull/128150 __

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,114 @@ +//===--- CapturingThisByFieldCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/130297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,44 @@ +//===--- CapturingThisByFieldCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,144 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s bugprone-capturing-this-by-field %t -- -config="{CheckOptions: {bugprone-capturing-this-by-field.FunctionWrapperTypes: '::std::function;::Fn'}}" -- + +namespace std { + +template +class function; + +template +c

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,326 @@ +//===--- UseScopedLockCheck.cpp - clang-tidy --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,326 @@ +//===--- UseScopedLockCheck.cpp - clang-tidy --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] support pointee mutation check in misc-const-correctness (PR #130494)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130494 >From 353f538f425ead9ee10ca6c046a6517b9e157db4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 9 Mar 2025 15:43:37 + Subject: [PATCH 1/7] [clang-tidy] support pointee mutation check in misc-const

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130297 >From 8ef214f6c78d710dbd9c74b06c7c637baf93e527 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 8 Mar 2025 00:03:39 +0800 Subject: [PATCH 1/6] [clang-tidy] Add new check bugprone-capture-this-by-field

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,37 @@ +.. title:: clang-tidy - bugprone-capturing-this-by-field + +bugprone-capturing-this-by-field HerrCai0907 wrote: what do you think `bugprone-capturing-this-in-member-variable`. It is longer then field but IMO may be clearer. I don't like `bugpro

[clang-tools-extra] [clang-tidy] support pointee mutation check in misc-const-correctness (PR #130494)

2025-03-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130494 >From 353f538f425ead9ee10ca6c046a6517b9e157db4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 9 Mar 2025 15:43:37 + Subject: [PATCH 1/8] [clang-tidy] support pointee mutation check in misc-const

[clang-tools-extra] [clang-tidy] support pointee mutation check in misc-const-correctness (PR #130494)

2025-03-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130494 >From 353f538f425ead9ee10ca6c046a6517b9e157db4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 9 Mar 2025 15:43:37 + Subject: [PATCH 1/9] [clang-tidy] support pointee mutation check in misc-const

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-12 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,37 @@ +.. title:: clang-tidy - bugprone-capturing-this-by-field + +bugprone-capturing-this-by-field + + +Finds lambda captures that capture the ``this`` pointer and store it as class +members without handle the copy and move constructors

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130297 >From 8ef214f6c78d710dbd9c74b06c7c637baf93e527 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 8 Mar 2025 00:03:39 +0800 Subject: [PATCH 1/7] [clang-tidy] Add new check bugprone-capture-this-by-field

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130297 >From 8ef214f6c78d710dbd9c74b06c7c637baf93e527 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 8 Mar 2025 00:03:39 +0800 Subject: [PATCH 1/8] [clang-tidy] Add new check bugprone-capture-this-by-field

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,144 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s bugprone-capturing-this-by-field %t -- -config="{CheckOptions: {bugprone-capturing-this-by-field.FunctionWrapperTypes: '::std::function;::Fn'}}" -- HerrCai0907 wrote: Unfortunately, I am not f

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-11 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,144 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s bugprone-capturing-this-by-field %t -- -config="{CheckOptions: {bugprone-capturing-this-by-field.FunctionWrapperTypes: '::std::function;::Fn'}}" -- + +namespace std { + +template +class function; --

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-12 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,144 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s bugprone-capturing-this-by-field %t -- -config="{CheckOptions: {bugprone-capturing-this-by-field.FunctionWrapperTypes: '::std::function;::Fn'}}" -- + +namespace std { + +template +class function; + +template +c

[clang-tools-extra] [clang-tidy] add AllowedTypes option to misc-const-correctness (PR #122951)

2025-02-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/122951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add AllowedTypes option to misc-const-correctness (PR #122951)

2025-02-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/122951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add an option to treat warnings as errors (PR #128221)

2025-02-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM. Please note this in release note https://github.com/llvm/llvm-project/pull/128221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang-tools-extra] [clang-tidy]improve performance-unnecessary-value-param performance (PR #128383)

2025-02-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/128383 Tolerate fix-it breaking compilation when functions is used as pointers. `isReferencedOutsideOfCallExpr` will visit the whole translate unit for each matched function decls. It will waste lots of cpu time in

[clang] [clang-tools-extra] [clang-tidy][NFC] Expose HeuristicResolver::lookupDependentName() and use it in StandaloneEmptyCheck (PR #128391)

2025-02-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM as temporary solution But clang-tidy actually do not want to reply on `Sema`. I take a look briefly about `HeuristicResolver`, it looks like not related to other Sema parts. Is it possible to move the whole `HeuristicResolver` out

[clang-tools-extra] [clang-tidy][NFC][docs] Use single tick for 'false' and 'true' values in options (PR #128362)

2025-02-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/128362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] fix fp when modifying variant by ``operator[]`` with template in parameters (PR #128407)

2025-02-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/128407 `ArraySubscriptExpr` can switch base and idx. For dependent array subscript access, we should check both base and idx conservatively. >From ff265c9f01d68b8657d217ba4ea62b77a5775bb5 Mon Sep 17 00:00:00 2001

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-22 Thread Congcong Cai via cfe-commits
Carlos =?utf-8?q?Gálvez?= , Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/128150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,69 @@ +//===--- UnintendedCharOstreamOutputCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 1/9] [clang-tidy]add new check bugprone-unintended-char-ostre

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 1/9] [clang-tidy]add new check bugprone-unintended-char-ostre

[clang-tools-extra] [clang-tidy]improve performance-unnecessary-value-param performance (PR #128383)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/128383 >From 721393e8f1a464931884be95fef48518f8c351f1 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 23 Feb 2025 08:36:53 +0800 Subject: [PATCH 1/2] [clang-tidy]improve performance-unnecessary-value-param

[clang-tools-extra] [clang-tidy] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -22,7 +22,8 @@ namespace clang::tidy::performance { class NoexceptFunctionBaseCheck : public ClangTidyCheck { public: NoexceptFunctionBaseCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} + : ClangTidyCheck(Name, Context) +

[clang-tools-extra] [clang-tidy] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -110,6 +110,12 @@ Changes in existing checks ` check by providing additional examples and fixing some macro related false positives. +- Improved :doc:`performance-noexcept-move-constructor + ` check by adding + a new (off-by-default) option `AllowFalseEvaluated`, whic

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-02-24 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: I am not a native English speaker, just a personal feeling. I prefer `AllowOmittingNamespaceComments` since it is clearer then `AllowNoNamespaceComments`. https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commits mailing lis

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-02-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-02-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: Could you organize test. It looks like copy from other tests and have some noise which has nothing to do with the function of the current PR. Also, please rebase to main since release note is cleared https://github.com/llvm/llvm-project/pull/124265 ___

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 01/10] [clang-tidy]add new check bugprone-unintended-char-ost

[clang-tools-extra] [clang-tidy]improve performance-unnecessary-value-param performance (PR #128383)

2025-02-24 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ### Merge activity * **Feb 24, 9:58 AM EST**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/128383). https://github.com/llvm/llvm-project/pull/128383

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-22 Thread Congcong Cai via cfe-commits
Carlos =?utf-8?q?Gálvez?= , Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: @@ -449,6 +479,10 @@ ClangTidyASTConsumerFactory::createASTConsumer( } std::vector> Consumers; + + if (!Context.getOptions().SystemHeaders.value_or(false)) +Consumers.push_back(std::make

[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-02-22 Thread Congcong Cai via cfe-commits
Carlos =?utf-8?q?Gálvez?= , Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/HerrCai0907 commented: Will be better to use decorator pattern instead of ad preprocess consumer. Most of clang-tidy check does not reply on ast matcher result in system header. but it is maybe n

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. lgtm. please run git-clang-format also. i think there are format issue in the new code. https://github.com/llvm/llvm-project/pull/128402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread Congcong Cai via cfe-commits
@@ -44,6 +44,12 @@ void MoveConstArgCheck::registerMatchers(MatchFinder *Finder) { unless(isInTemplateInstantiation())) .bind("call-move"); + // Match ternary expressions where either branch contains std::move + auto TernaryWithMoveMatcher = +

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/128402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC][docs] Use single tick for 'false' and 'true' values in options (PR #128362)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/128362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix invalid fixit from modernize-use-ranges for nullptr used with std::unique_ptr (PR #127162)

2025-02-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: LGTM. since it is just a patch instead of ideal solution for `std::equality_comparable_with` stuff, could you add some FIXME in code? https://github.com/llvm/llvm-project/pull/127162 ___ cfe-commits mailing li

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 1/7] [clang-tidy]add new check bugprone-unintended-char-ostre

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-20 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,69 @@ +//===--- UnintendedCharOstreamOutputCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/127720 >From b69bb465a24f2175f2f9f91f220252d3bcb27bde Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Feb 2025 07:38:37 +0800 Subject: [PATCH 1/8] [clang-tidy]add new check bugprone-unintended-char-ostre

[clang-tools-extra] [clang-tidy] Fix invalid fixit from modernize-use-ranges for nullptr used with std::unique_ptr (PR #127162)

2025-02-25 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping me if you want to merge it. https://github.com/llvm/llvm-project/pull/127162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix invalid fixit from modernize-use-ranges for nullptr used with std::unique_ptr (PR #127162)

2025-02-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/127162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]improve performance-unnecessary-value-param performance (PR #128383)

2025-02-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/128383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)

2025-02-27 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/128402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check bugprone-unintended-char-ostream-output (PR #127720)

2025-02-27 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/127720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] fix fp when modifying variant by ``operator[]`` with template in parameters (PR #128407)

2025-02-27 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping https://github.com/llvm/llvm-project/pull/128407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-04-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/131804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix false positives in `bugprone-crtp-constructor-accessibility` check (PR #132543)

2025-04-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/132543 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-29 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/133525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-26 Thread Congcong Cai via cfe-commits
@@ -89,6 +89,8 @@ void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { const auto ConstReference = hasType(references(isConstQualified())); HerrCai0907 wrote: I think the comment means check the constness of pointer and array instead of const

[clang-tools-extra] [clang-tidy] Fix broken HeaderFilterRegex when read from config file (PR #133582)

2025-04-03 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/133582 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-capturing-this-in-member-variable` check: add support of `bind` functions. (PR #132635)

2025-04-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/132635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-05-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/135383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-05-18 Thread Congcong Cai via cfe-commits
@@ -56,6 +60,13 @@ class UseTrailingReturnTypeCheck : public ClangTidyCheck { SourceRange ReturnTypeCVRange, const FunctionDecl &F, const FriendDecl *Fr, const ASTContext &Ctx, const SourceManager &SM, const Lang

[clang-tools-extra] [clang-tidy] Add support for lambda-expression in `use-trailing-return-type` check (PR #135383)

2025-05-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/135383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/141410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/140388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/141410 >From ac614ac46750b19d2810d838112ba8b01388f577 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 25 May 2025 23:30:24 +0800 Subject: [PATCH 1/2] [NFC][clangd][test] add clang-tidy config to ensure test

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread Congcong Cai via cfe-commits
@@ -0,0 +1 @@ +InheritParentConfig: false HerrCai0907 wrote: path-mapping will copy all folder to tmp folder. but i agree disable clangtidy is better https://github.com/llvm/llvm-project/pull/141410 ___ cfe-commits ma

[clang-tools-extra] [clang-tidy] Fix false negative `modernize-use-ranges` when using getter function (PR #127377)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 requested changes to this pull request. https://github.com/llvm/llvm-project/pull/127377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/140388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix false negative `modernize-use-ranges` when using getter function (PR #127377)

2025-05-25 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: Maybe it is more straightforward to detect function which return ref of member variable like `const std::vector& get() const { return v; }` and bypass the SideEffect check. https://github.com/llvm/llvm-project/pull/127377 ___ cfe-c

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/131804 >From a686695e6691fcb824b2055c3dfa8f0fd3727355 Mon Sep 17 00:00:00 2001 From: DeNiCoN Date: Mon, 17 Mar 2025 08:04:32 + Subject: [PATCH 01/12] origin pr --- clang-tools-extra/clang-tidy/CMakeLists.txt

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/134375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -80,13 +78,47 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { if (!MatchedDecl) return; - if (Tracer.analyze(MatchedDecl).getBehaviour() == - utils::ExceptionAnalyzer::State::Throwing) -// FIXME: We should provide more informat

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -377,6 +402,8 @@ Task h_ShouldDiag(const int a, // CHECK-MESSAGES: :[[@LINE-2]]:45: warning: an exception may be thrown in function 'h_ShouldDiag' which should not throw exceptions co_yield a / b; } +// CHECK-MESSAGES: :133:7: note: frame #0: unhandled exception may be

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/134375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -80,13 +78,47 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { if (!MatchedDecl) return; - if (Tracer.analyze(MatchedDecl).getBehaviour() == - utils::ExceptionAnalyzer::State::Throwing) -// FIXME: We should provide more informat

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -80,13 +78,47 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { if (!MatchedDecl) return; - if (Tracer.analyze(MatchedDecl).getBehaviour() == - utils::ExceptionAnalyzer::State::Throwing) -// FIXME: We should provide more informat

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -80,13 +78,47 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { if (!MatchedDecl) return; - if (Tracer.analyze(MatchedDecl).getBehaviour() == - utils::ExceptionAnalyzer::State::Throwing) -// FIXME: We should provide more informat

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: Could you add some separate tests for this diagnostic? I am not sure current test case is covered all scenarios in this PR https://github.com/llvm/llvm-project/pull/134375 ___ cfe-commits mailing list cfe-com

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/134375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix false negative `modernize-use-ranges` when using getter function (PR #127377)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -51,7 +51,13 @@ static std::string getFullPrefix(ArrayRef Signature) { namespace { AST_MATCHER(Expr, hasSideEffects) { - return Node.HasSideEffects(Finder->getASTContext()); + bool CheckArg = true; + if (const CXXMemberCallExpr *Call = dyn_cast(&Node)) { +if (Call->

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/140388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

2025-05-25 Thread Congcong Cai via cfe-commits
@@ -80,13 +78,47 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { if (!MatchedDecl) return; - if (Tracer.analyze(MatchedDecl).getBehaviour() == - utils::ExceptionAnalyzer::State::Throwing) -// FIXME: We should provide more informat

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 converted_to_draft https://github.com/llvm/llvm-project/pull/131804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/141410 Under previous test setup, the test result will be influenced by clang-tidy file in parent folder (between llvm-projects root and build folder). It is inconventient and leads some confusion. This PR wants t

<    8   9   10   11   12   13