[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-initialization: Enhance the check for the scenario with MemberExpr initialization. (PR #151936)

2025-08-29 Thread Congcong Cai via cfe-commits
@@ -273,6 +273,18 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(LocalVarCopiedFrom(declRefExpr( to(varDecl(hasLocalStorage()).bind(OldVarDeclId, this); + + auto DeclRefToCo

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-29 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/155080 >From 00a2038a85eec59d263f756b85b8e0527266c500 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 23 Aug 2025 14:05:04 +0800 Subject: [PATCH 1/3] [clang][initlist] handle incomplete array type in Consta

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/155080 >From 00a2038a85eec59d263f756b85b8e0527266c500 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 23 Aug 2025 14:05:04 +0800 Subject: [PATCH 1/2] [clang][initlist] handle incomplete array type in Consta

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/155080 >From 00a2038a85eec59d263f756b85b8e0527266c500 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 23 Aug 2025 14:05:04 +0800 Subject: [PATCH 1/2] [clang][initlist] handle incomplete array type in Consta

[clang-tools-extra] [clang-tidy] Mark bunch of checks as C++-only (PR #155083)

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

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/155080 >From 00a2038a85eec59d263f756b85b8e0527266c500 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 23 Aug 2025 14:05:04 +0800 Subject: [PATCH] [clang][initlist] handle incomplete array type in Constant E

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/155080 >From c0b28af40d2b9feaf388fdb841e80f6e70864192 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 23 Aug 2025 14:05:04 +0800 Subject: [PATCH] [clang][initlist] handle incomplete array type in Constant E

[clang] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-08-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/155080 fix: #151716 In #65918, support of incomplete array type is added in TryReferenceListInitialization. It causes the crash in Constant Expr Calculation since it only considers the case where it is ConstantAr

[clang-tools-extra] Add option to allow pre/post increment/decrement operator in cppcoreg… (PR #155015)

2025-08-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/155015 ___ 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-08-10 Thread Congcong Cai via cfe-commits
@@ -33,6 +33,9 @@ If CMake is configured with ``CLANG_TIDY_ENABLE_STATIC_ANALYZER=NO``, :program:`clang-tidy` will not be built with support for the ``clang-analyzer-*`` checks or the ``mpi-*`` checks. +If CMake is configured with ``CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS

[clang-tools-extra] [clang-tidy] `readability-container-size-empty`: Correctly generating fix hints when size method is called from implicit this (PR #152486)

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

[clang-tools-extra] [clang-tidy] `modernize-use-trailing-return-type`: add an option to apply to `void`-returning functions as well (PR #129406)

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

[clang-tools-extra] [clang-tidy] `modernize-use-trailing-return-type`: add an option to apply to `void`-returning functions as well (PR #129406)

2025-08-07 Thread Congcong Cai via cfe-commits
@@ -190,6 +195,11 @@ Changes in existing checks ` check by adding the option `IgnoreAliasing`, that allows not looking at underlying types of type aliases. +- Improved :doc:`performance-unnecessary-value-param + ` check performance by + tolerating fix-it breaking compil

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

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

[clang-tools-extra] [clang-tidy][mlir] Make rewrite more conservative. (PR #150757)

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

[clang-tools-extra] [clang-tidy] Make `modernize-use-using`'s fix-its more robust (PR #149694)

2025-07-27 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: Does it fix #150276 also? https://github.com/llvm/llvm-project/pull/149694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Make `modernize-use-using`'s fix-its more robust (PR #149694)

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

[clang-tools-extra] 59fdd97 - [clang-tidy][NFC] typo in UseUsingCheck

2025-07-26 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2025-07-27T10:11:06+08:00 New Revision: 59fdd97fe6d4e84d653cd005cddb50c1f2eedcb7 URL: https://github.com/llvm/llvm-project/commit/59fdd97fe6d4e84d653cd005cddb50c1f2eedcb7 DIFF: https://github.com/llvm/llvm-project/commit/59fdd97fe6d4e84d653cd005cddb50c1f2eedcb7.diff

[clang-tools-extra] [clang-tidy] Fix false positives in `bugprone-signed-char-misuse` (PR #149790)

2025-07-22 Thread Congcong Cai via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: https://github.com/HerrCai0907 commented: what about enum with unsigned underlying type. it looks not covered by tests https://github.com/llvm/llvm-project/pull/149790 __

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-07-16 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: Are they really need to "std::move" in the patch? I think `MixData` is meaningless since it is still need to copy all field. https://github.com/llvm/llvm-project/pull/148549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang-tools-extra] [clang-tidy] Improve `bugprone-infinite-loop` check by adding handing for structured bindings (PR #144213)

2025-07-16 Thread Congcong Cai via cfe-commits
@@ -83,6 +83,23 @@ static bool isVarThatIsPossiblyChanged(const Decl *Func, const Stmt *LoopStmt, isChanged(LoopStmt, Var, Context); // FIXME: Track references. } + +if (const auto *BD = dyn_cast(DRE->getDecl())) { + if (const auto *DD = +

[clang-tools-extra] [clang-tidy] Improve `bugprone-infinite-loop` check by adding handing for structured bindings (PR #144213)

2025-07-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM except nit https://github.com/llvm/llvm-project/pull/144213 ___ 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-infinite-loop` check by adding handing for structured bindings (PR #144213)

2025-07-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/144213 ___ 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] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/148547 ___ 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] concat static-analyzer name at compilation time (PR #147406)

2025-07-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/147406 ___ 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-07-06 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping @PiotrZSL @carlosgalvezp 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] Add misc-bool-bitwise-operation check (PR #142324)

2025-06-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/142324 ___ 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 misc-bool-bitwise-operation check (PR #142324)

2025-06-22 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,219 @@ +//===--- BoolBitwiseOperationCheck.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 misc-bool-bitwise-operation check (PR #142324)

2025-06-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/142324 ___ 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-06-22 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,146 @@ +//===--- QueryCheck.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] Improve `readability-function-size`: count class member initializers as statements (PR #131669)

2025-06-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/131669 ___ 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 `readability-function-size`: count class member initializers as statements (PR #131669)

2025-06-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 unassigned https://github.com/llvm/llvm-project/pull/131669 ___ 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-06-16 Thread Congcong Cai via cfe-commits
@@ -104,7 +104,9 @@ Improvements to clang-tidy clauses. Added a ``--match-partial-fixes`` option to keep previous behavior on specific tests. This may break tests for users with custom out-of-tree checks who use :program:`check_clang_tidy.py` as-is. - +- :program:`clang-

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

2025-06-16 Thread Congcong Cai via cfe-commits
@@ -104,7 +104,14 @@ Improvements to clang-tidy clauses. Added a ``--match-partial-fixes`` option to keep previous behavior on specific tests. This may break tests for users with custom out-of-tree checks who use :program:`check_clang_tidy.py` as-is. - +- :program:`clang

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

2025-06-16 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,63 @@ + +Query Based Custom Clang-Tidy Checks + + +Introduction + + +This page provides examples of how to add query based custom checks for +:program:`clang-tidy`. + +Custom checks are

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-06-16 Thread Congcong Cai via cfe-commits
@@ -985,6 +985,20 @@ auto buildTransferMatchSwitch() { isOptionalMemberCallWithNameMatcher(hasName("isNull")), transferOptionalIsNullCall) + // NullableValue::makeValue, NullableValue::makeValueInplace + // Only NullableValue has these methods, bu

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

2025-06-15 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping @PiotrZSL @vbvictor @carlosgalvezp I have updated the PR according to comment and updated the description, could you review it again? https://github.com/llvm/llvm-project/pull/131804 ___ cfe-commits mailing list cfe-commits@li

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

2025-06-15 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] add 'IgnoreMarcos' option to 'avoid-goto' check (PR #143554)

2025-06-13 Thread Congcong Cai via cfe-commits
@@ -132,8 +133,41 @@ void jump_out_backwards() { for (int j = 0; j < 10; ++j) { if (i * j > 80) goto before_the_loop; - // CHECK-NOTES: [[@LINE-1]]:9: warning: avoid using 'goto' for flow control - // CHECK-NOTES: [[@LINE-8]]:1: note: label defined

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

2025-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/140912 ___ 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-06-13 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > This feature request requires adding _a lot_ of things in the config file. > And once it's in, people will want _more_ things in it (eventually they will > want exactly the same functionality as can be achieved by regular checks). So > I see this feature growing without po

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

2025-06-13 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/13] origin pr --- clang-tools-extra/clang-tidy/CMakeLists.txt

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

2025-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 ready_for_review 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] support query based custom check (PR #131804)

2025-06-13 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] support query based custom check (PR #131804)

2025-06-12 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] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-12 Thread Congcong Cai via cfe-commits
@@ -219,6 +219,12 @@ Changes in existing checks tolerating fix-it breaking compilation when functions is used as pointers to avoid matching usage of functions within the current compilation unit. +- Improved :doc: `bugprone-sizeof-expression + ` check. + + Introduced WarnO

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM exception release note and doc. https://github.com/llvm/llvm-project/pull/143205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/143205 ___ 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] fix 'misc-use-internal-linkage' check warnings (PR #143482)

2025-06-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/143482 ___ 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] run clang-format over `abseil` and `altera` checks. (PR #143314)

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

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-06-02 Thread Congcong Cai via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -0,0 +1,136 @@ +//===--- FunctionVisibilityChangeCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM

[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] 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 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] [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
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] 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] 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] 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
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
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
@@ -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 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
@@ -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
@@ -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] [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

[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] 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] [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] [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 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] Add flag to specify an alternative to std::forward (PR #138755)

2025-05-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM. It looks similar as https://github.com/llvm/llvm-project/pull/138757. could you add a test for both PR. https://github.com/llvm/llvm-project/pull/138755 ___ cfe-commits mailing list cfe-

[clang-tools-extra] [clang-tidy] Add flag to specify an alternative to std::move in cppcoreguidelines-rvalue-reference-param-not-moved (PR #138757)

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

[clang-tools-extra] Add flag to specify an alternative to std::move (PR #138757)

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

[clang-tools-extra] Add flag to specify an alternative to std::move (PR #138757)

2025-05-07 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > Since :: are specified before std::move, I am not entirely sure whether it > would be required for the custom function. In my testing it worked both with > and without ::. with :: means is a full name including namespace, without :: means only match function name. https:

[clang-tools-extra] Add flag to specify an alternative to std::move (PR #138757)

2025-05-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/138757 ___ 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 `readability-redundant-inline-specifier` (PR #135391)

2025-04-28 Thread Congcong Cai via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/135391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

2025-04-27 Thread Congcong Cai via cfe-commits
@@ -52,8 +54,17 @@ intCastExpression(bool IsSigned, const auto StaticCastExpr = cxxStaticCastExpr(has(ImplicitCastExpr)); const auto FunctionalCastExpr = cxxFunctionalCastExpr(has(ImplicitCastExpr)); + // Match function calls or variable references not directly wrapped by

[clang-tools-extra] [clang-tidy] Do not pass any file when listing checks in run_clang_ti… (PR #137286)

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

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

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

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-22 Thread Congcong Cai via cfe-commits
@@ -209,3 +209,18 @@ struct S15{ S15(S14& d):d{d}{} S14& d; }; + +//Issue #133715 +namespace std { HerrCai0907 wrote: clang-tidy@main will also not give warning for this code. https://github.com/llvm/llvm-project/pull/134774 __

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

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

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

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

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

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

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 requested changes to this pull request. exclude std::array don't resolve problem here. It can also happen in user defined class. e.g. https://godbolt.org/z/cn46MT5Mn https://github.com/llvm/llvm-project/pull/134774 ___ c

[clang-tools-extra] [clang-tide] added `AllowedTypes` option to `readability-qualified-auto` check (PR #136571)

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

[clang-tools-extra] [clang-tidy] treat unsigned char and signed char as char type by default in bugprone-unintended-char-ostream-output (PR #134870)

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

[clang-tools-extra] [clang-tidy] treat unsigned char and signed char as char type by default in bugprone-unintended-char-ostream-output (PR #134870)

2025-04-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/134870 >From badfb83ff201f021363e9634b4296e040251d408 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 8 Apr 2025 15:27:54 + Subject: [PATCH 1/2] [clang-tidy] treat unsigned char and signed char as char

[clang-tools-extra] [clang-tidy] treat unsigned char and signed char as char type by default in bugprone-unintended-char-ostream-output (PR #134870)

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

[clang-tools-extra] [clang-tidy] `matchesAnyListedTypeName` support non canonical types (PR #134869)

2025-04-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/134869 ___ 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-12 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping for which kind of configuration format should we choose? - flattening - structured - from cli https://github.com/llvm/llvm-project/pull/131804#issuecomment-2753607226 https://github.com/llvm/llvm-project/pull/131804 ___ cfe-com

[clang-tools-extra] [clang-tidy] `matchesAnyListedTypeName` support non canonical types (PR #134869)

2025-04-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/134869 >From 104d0cc45797b5033a88f016a7f1ec3d88529505 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 8 Apr 2025 15:26:44 + Subject: [PATCH] [clang-tidy] `matchesAnyListedTypeName` support non canonical

[clang-tools-extra] [clang-tidy] `matchesAnyListedTypeName` support non canonical types (PR #134869)

2025-04-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/134869 >From 833d092fd262c4139488dc6f227f2b78180dd5da Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 8 Apr 2025 15:26:44 + Subject: [PATCH] [clang-tidy] `matchesAnyListedTypeName` support non canonical

[clang-tools-extra] [clang-tidy] `matchesAnyListedTypeName` support non canonical types (PR #134869)

2025-04-12 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ### Merge activity * **Apr 12, 11:58 PM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/134869). https://github.com/llvm/llvm-project/pull/134869 ___

[clang-tools-extra] [clang-tidy][NFC] update test name and config for bugprone-unintended-char-ostream-output (PR #134868)

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

  1   2   3   4   5   6   7   8   9   10   >