[clang-tools-extra] [clang-tidy][NFC] let multi-line string first line does not wrap (PR #160019)

2025-09-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/160019 ___ 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 readability-redundant-parentheses (PR #159911)

2025-09-21 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,31 @@ + +//===--===// +// +// 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][NFC] let multi-line string first line does not wrap (PR #160019)

2025-09-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/160019 ___ 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 readability-redundant-parentheses (PR #159911)

2025-09-21 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,54 @@ + HerrCai0907 wrote: fix script in #160019 https://github.com/llvm/llvm-project/pull/159911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang-tools-extra] [clang-tidy][NFC] let multi-line string first line does not wrap (PR #160019)

2025-09-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/160019 add \ to avoid a blank first line >From f75f6e96538e8de5b639a9416ee979b0f4de0de8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 22 Sep 2025 10:00:30 +0800 Subject: [PATCH] [clang-tidy][NFC] let mul

[clang-tools-extra] [clang-tidy] add readability-redundant-parentheses (PR #159911)

2025-09-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/159911 >From ad8fc039e1aea131c56c356e88c8c1a4c9afe737 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 19 Sep 2025 23:28:30 +0800 Subject: [PATCH 1/2] [clang-tidy] add readability-redundant-parentheses This

[clang-tools-extra] [clang-tidy] add readability-redundant-parentheses (PR #159911)

2025-09-21 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,58 @@ +// RUN: %check_clang_tidy %s readability-redundant-parentheses %t HerrCai0907 wrote: Not sure if this is necessary, since it seems that this check has no standard-related content. https://github.com/llvm/llvm-project/pull/159911 __

[clang-tools-extra] [clang-tidy] Rename 'cert-dcl50-cpp' to 'modernize-avoid-variadic-functions' (PR #157737)

2025-09-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/157737 ___ 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 comment in llvm-use-ranges for add_new_check.py (PR #159927)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/159927 ___ 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 comment in llvm-use-ranges for add_new_check.py (PR #159927)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/159927 >From 763c2dfdf4f8398d7b66915a2f9d3ee8f167f415 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Sep 2025 22:01:42 +0800 Subject: [PATCH] [clang-tidy][NFC] add comment in llvm-use-ranges for add_new

[clang-tools-extra] [clang-tidy][NFC] Enable 'readability-named-parameter' check (PR #158774)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: Do we really need it? IMO it is fine to keep parameter name empty when we don't need it. @carlosgalvezp @5chmidti @vbvictor https://github.com/llvm/llvm-project/pull/158774 ___ cfe-commits mailing list cfe-

[clang-tools-extra] [clang-tidy][NFC] add comment in llvm-use-ranges for add_new_check.py (PR #159927)

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

[clang-tools-extra] [clang-tidy][custom-check][NFC] fix test when `CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` disable (#159809) (PR #159809)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/159809 ___ 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 cmake issue (PR #159919)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/159919 ___ 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 cmake issue (PR #159919)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/159919 >From 157b39f8d99a85ad202f345eaa107f7e7872962f Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Sep 2025 20:19:51 +0800 Subject: [PATCH] [clang-tidy][NFC] fix cmake issue Fixed: #159409 `clang_targ

[clang-tools-extra] [clang-tidy][NFC] add comment in llvm-use-ranges for add_new_check.py (PR #159927)

2025-09-20 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > LGTM, but does it matter if it already says "Yes" in "Offers fixes" in > https://clang.llvm.org/extra/clang-tidy/checks/list.html? If we re-run python script, the "yes" will disappear which is quiet annoying. https://github.com/llvm/llvm-project/pull/159927 ___

[clang-tools-extra] [clang-tidy][NFC] add comment in llvm-use-ranges for add_new_check.py (PR #159927)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/159927 None >From 763c2dfdf4f8398d7b66915a2f9d3ee8f167f415 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Sep 2025 22:01:42 +0800 Subject: [PATCH] [clang-tidy][NFC] add comment in llvm-use-ranges for a

[clang-tools-extra] [clang-tidy][NFC] fix cmake issue (PR #159919)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 auto_merge_disabled https://github.com/llvm/llvm-project/pull/159919 ___ 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 cmake issue (PR #159919)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 auto_merge_enabled https://github.com/llvm/llvm-project/pull/159919 ___ 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 cmake issue (PR #159919)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/159919 Fixed: #159409 `clang_target_link_libraries` can only be used for clang libraries. The libararies in here will not be link when `LLVM_LINK_LLVM_DYLIB` is enabled. >From 157b39f8d99a85ad202f345eaa107f7e7872

[clang-tools-extra] [clang-tidy] add readability-redundant-parentheses (PR #159911)

2025-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/159911 This check wants to detect a common happened case that forgetting to remove parenthese during modifying code. >From ad8fc039e1aea131c56c356e88c8c1a4c9afe737 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date

[clang-tools-extra] [clang-tidy][custom-check][NFC] fix test when `CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` disable (PR #159809)

2025-09-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/159809 >From bef3d5e18a498e31057adccf80b637707d14ab74 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Sep 2025 00:17:23 +0800 Subject: [PATCH 1/2] [clang-tidy][custom-check] fix CI when CLANG_TIDY_ENABLE

[clang-tools-extra] [clang-tidy][custom-check][NFC] fix test when `CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` disable (PR #159809)

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

[clang-tools-extra] [clang-tidy][custom-check][NFC] fix test when `CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` disable (PR #159809)

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

[clang-tools-extra] [clang-tidy][custom-check][NFC] fix test when `CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` disable (PR #159809)

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

[clang-tools-extra] [clang-tidy][custom-check][NFC] fix test when `CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` disable (PR #159809)

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

[clang-tools-extra] [llvm] reapply "[clang-tidy] support query based custom check" (PR #159547)

2025-09-19 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: fixed in https://github.com/llvm/llvm-project/pull/159809 > These tests seem to fail when the new option is set to OFF: > > ``` > Clang Tools :: clang-tidy/checkers/custom/query-incorrect-query.cpp > Clang Tools :: clang-tidy/checkers/custom/query-partially-active-check.c

[clang-tools-extra] [clang-tidy][custom-check] fix CI when CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS disable (PR #159809)

2025-09-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/159809 None >From bef3d5e18a498e31057adccf80b637707d14ab74 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Sep 2025 00:17:23 +0800 Subject: [PATCH] [clang-tidy][custom-check] fix CI when CLANG_TIDY_ENAB

[clang-tools-extra] [llvm] reapply "[clang-tidy] support query based custom check" (PR #159547)

2025-09-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/159547 ___ 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 `modernize-use-structured-binding` (PR #158462)

2025-09-18 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,419 @@ +//===--===// +// +// 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 `modernize-use-structured-binding` (PR #158462)

2025-09-18 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,419 @@ +//===--===// +// +// 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 `modernize-use-structured-binding` (PR #158462)

2025-09-18 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,419 @@ +//===--===// +// +// 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] improve robustness of the member initializer detection in modernize-use-default-member-init (PR #159392)

2025-09-18 Thread Congcong Cai via cfe-commits
@@ -282,6 +282,10 @@ Changes in existing checks uses of non-standard ``enable_if`` with a signature different from ``std::enable_if`` (such as ``boost::enable_if``). +- Improved :doc:`modernize-use-default-member-init + ` check to + improve the robustness of the member i

[clang-tools-extra] [clang-tidy] improve robustness of the member initializer detection in modernize-use-default-member-init (PR #159392)

2025-09-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/159392 >From 4b48bee51493f0f7b48f45c8da213bf70d496b69 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 17 Sep 2025 23:59:25 +0800 Subject: [PATCH 1/2] [clang-tidy] improve robustness of the member initializer

[clang-tools-extra] [llvm] reapply "[clang-tidy] support query based custom check" (PR #159547)

2025-09-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: I found how to reproduce it. Build failed happened in ubuntu with `cmake -S llvm -B build/release-gcc-shared -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=1 -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_ENABLE_PROJECTS="clang;clang-too

[clang-tools-extra] [llvm] reapply "[clang-tidy] support query based custom check" (PR #159547)

2025-09-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: I think it works now. https://github.com/llvm/llvm-project/pull/159547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] reapply "[clang-tidy] support query based custom check" (PR #159547)

2025-09-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: @ingomueller-net could you kindly review this PR. I think I have fixed build issue but since I cannot reproduce it locally. I am not 100% sure it can work. https://github.com/llvm/llvm-project/pull/159547 ___ cfe-commits mailing lis

[clang-tools-extra] [clang-tidy] improve robustness of the member initializer detection in modernize-use-default-member-init (PR #159392)

2025-09-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/159392 ___ 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 `modernize-use-structured-binding` (PR #158462)

2025-09-17 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,419 @@ +//===--===// +// +// 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 `modernize-use-structured-binding` (PR #158462)

2025-09-17 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,419 @@ +//===--===// +// +// 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] improve robustness of the member initializer detection in modernize-use-default-member-init (PR #159392)

2025-09-17 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/159392 Fixed #156295, #122480 The original ast matcher based member initializer detection is bug prone. In this PR we introduce a new recusively detection which can be easier extended to detect whether we can move

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

2025-09-17 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > I see builds failing in the link, per the report from @llvm-ci above: > https://lab.llvm.org/buildbot/#/builders/145/builds/9815 > > ``` > FAILED: lib/libclangTidy.so.22.0git > : && /home/buildbots/llvm-external-buildbots/clang.19.1.7/bin/clang++ > --gcc-toolchain=/gcc-to

[clang-tools-extra] [clang-tidy] Add check performance-lost-std-move (PR #139525)

2025-09-16 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,195 @@ +//===--- LostStdMoveCheck.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 check performance-lost-std-move (PR #139525)

2025-09-16 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,203 @@ +// RUN: %check_clang_tidy %s performance-lost-std-move %t + +namespace std { + +template +class shared_ptr { +public: + T& operator*() { return reinterpret_cast(*this); } + shared_ptr() {} + shared_ptr(const shared_ptr&) {} +}; + +template +T&& move(T&) +{ +}

[clang-tools-extra] [clang-tidy] Add check performance-lost-std-move (PR #139525)

2025-09-16 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,47 @@ +.. title:: clang-tidy - performance-lost-std-move + +performance-lost-std-move += + +Warns if copy constructor is used instead of ``std::move()`` and suggests a fix. +It honours cycles, lambdas, and unspecified call order in compound expr

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

2025-09-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed 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 new check `modernize-use-structured-binding` (PR #158462)

2025-09-16 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,419 @@ +//===--===// +// +// 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 check performance-lost-std-move (PR #139525)

2025-09-15 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,47 @@ +.. title:: clang-tidy - performance-lost-std-move + +performance-lost-std-move += + +Warns if copy constructor is used instead of ``std::move()`` and suggests a fix. +It honours cycles, lambdas, and unspecified call order in compound expr

[clang-tools-extra] [clang-tidy] Add check performance-lost-std-move (PR #139525)

2025-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: What's the differences between this check and `modernize-pass-by-value`? Although the names are different, they are essentially checking similar things. https://github.com/llvm/llvm-project/pull/139525 ___ cfe

[clang-tools-extra] [clang-tidy] Add check performance-lost-std-move (PR #139525)

2025-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/139525 ___ 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-09-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/155080 ___ 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 modernize-use-constexpr check (PR #146553)

2025-09-07 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,1038 @@ +//===--- UseConstexprCheck.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: A

[clang-tools-extra] [Clang-Tidy] Add google-runtime-float Clang-Tidy check (PR #156763)

2025-09-05 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,10 @@ +.. title:: clang-tidy - google-runtime-float + +google-runtime-float + + +Finds uses of ``long double`` and suggests replacing them with 64-bit +or 128-bit floating-point types. HerrCai0907 wrote: agree. I am also wondering w

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

2025-09-05 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/155080 ___ 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-09-05 Thread Congcong Cai via cfe-commits
@@ -4030,10 +4030,12 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, LastField = nullptr; if (ObjType->isArrayType()) { // Next subobject is an array element. - const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(ObjType

[clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

2025-09-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. clang-tools-extra/clang-tidy part LGTM https://github.com/llvm/llvm-project/pull/156270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-09-04 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,972 @@ +//===--- UseConstexprCheck.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] [clang][initlist] handle incomplete array type in Constant Expr Calculation (PR #155080)

2025-09-04 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/4] [clang][initlist] handle incomplete array type in Consta

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

2025-09-04 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 auto_merge_enabled https://github.com/llvm/llvm-project/pull/155080 ___ 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 google-runtime-float Clang-Tidy check (PR #156763)

2025-09-04 Thread Congcong Cai via cfe-commits
@@ -238,6 +238,7 @@ Clang-Tidy Checks :doc:`google-readability-avoid-underscore-in-googletest-name `, :doc:`google-readability-casting `, :doc:`google-readability-todo `, + :doc:`google-runtime-float `, "Yes" HerrCai0907 wrote: this check does not

[clang-tools-extra] [Clang-Tidy] Handle nested-name-specifier in "llvm-prefer-isa-or-dyn-cast-in-conditionals" (PR #155982)

2025-08-31 Thread Congcong Cai via cfe-commits
@@ -76,6 +136,16 @@ bool foo(Y *y, Z *z) { // CHECK-MESSAGES: :[[@LINE-2]]:7: warning: isa_and_nonnull<> is preferred // CHECK-FIXES: if (isa_and_nonnull(z->bar())) + if (z->bar() && cast_or_null(z->bar())) +return true; + // CHECK-MESSAGES: :[[@LINE-2]]:7: warning:

[clang-tools-extra] [Clang-Tidy] Handle nested-name-specifier in "llvm-prefer-isa-or-dyn-cast-in-conditionals" (PR #155982)

2025-08-30 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM. since you have already changing the matcher a lot. could you give more meaningful name for each locals. e.g. Any, Condition, ... https://github.com/llvm/llvm-project/pull/155982 ___ cfe-

[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

  1   2   3   4   5   6   7   8   9   10   >