[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > I'm not sure I understand this change. `std::span` is not a replacement for a > C array, since it does not own memory. I don't understand also the change > from suggesting to use `std::vector` instead of `std::array` The C-Array in parameter also does not own memory. It is

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

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

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108555 >From 35742b5f2f085b8f6626456cd0d21ebecbe8f831 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Sep 2024 23:11:51 +0800 Subject: [PATCH 1/2] [clang-tidy]suggest use `std::span` as replacement of c

[clang-tools-extra] [NFC][clang-tidy] document fix to bugprone-return-const-ref-from-parameter (PR #107641)

2024-09-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/107641 ___ 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 default error message for performance-avoid-endl (PR #107867)

2024-09-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/107867 ___ 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 positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-13 Thread Congcong Cai via cfe-commits
@@ -72,7 +72,7 @@ static FindArgsResult findArgs(const CallExpr *Call) { return Result; } -static SmallVector +static std::pair> HerrCai0907 wrote: Could you add some comments of this result. since bool means nothing. https://github.com/llvm/llvm-project/p

[clang-tools-extra] [clang-tidy] fix false positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/107649 ___ 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 positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-13 Thread Congcong Cai via cfe-commits
@@ -116,6 +116,11 @@ Changes in existing checks ` check to avoid false positive for C++23 deducing this. +- Improved :doc:`modernize-min-max-use-initializer-list + ` check by removing HerrCai0907 wrote: > removing a false positive Maybe fixing or avoidi

[clang-tools-extra] [clang-tidy] fix false positive in modernize-min-max-use-initializer-list (PR #107649)

2024-09-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Analysis] Avoid repeated hash lookups (NFC) (PR #108674)

2024-09-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/108674 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ast-matcher] Fixed a crash when traverse lambda expr with invalid captures (PR #108689)

2024-09-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/108689 Fixes: #106444 >From af8720ade42fef1571b59e2ca21943abc6b998d1 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 14 Sep 2024 15:38:11 +0800 Subject: [PATCH] [ast-matcher] Fixed a crash when traverse la

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-14 Thread Congcong Cai via cfe-commits
@@ -72,11 +81,24 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { void AvoidCArraysCheck::check(const MatchFinder::MatchResult &Result) { const auto *ArrayType = Result.Nodes.getNodeAs("typeloc"); - + const bool IsInParam = + Result.Nodes.getNodeAs("

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108555 >From 35742b5f2f085b8f6626456cd0d21ebecbe8f831 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Sep 2024 23:11:51 +0800 Subject: [PATCH 1/3] [clang-tidy]suggest use `std::span` as replacement of c

[clang] 11f9008 - [ast matcher][NFC] fix typo in release note

2024-09-14 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-09-14T21:27:35+08:00 New Revision: 11f9008daec2b5593dfcc781ee879f93de121da2 URL: https://github.com/llvm/llvm-project/commit/11f9008daec2b5593dfcc781ee879f93de121da2 DIFF: https://github.com/llvm/llvm-project/commit/11f9008daec2b5593dfcc781ee879f93de121da2.diff

[clang-tools-extra] [clang-tidy] fix false positive that floating point variable only used in increment expr in cert-flp30-c (PR #108706)

2024-09-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/108706 Fixes: #108049 cert-flp30-c only provides non-compliant example with normal loop. Essentially it wants to avoid that floating point variables are used as loop counters which are checked in condition expr and

[clang-tools-extra] [clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (PR #108743)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/108743 Fixes: #82970 Detecting dependiences with `varDecl` is too strict. It will ignore the `bingingDecl`. This patch wants to use `valueDecl` to match more cases including `bingingDecl`. >From b81896cc8c5bef06

[clang] [clang][NFC] declare internal linkage function static (PR #108759)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/108759 Detected by `misc-use-internal-linkage` >From 3e4add8033e9ca6d3c4b5fb062a6370a07e71381 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 15 Sep 2024 21:18:01 +0800 Subject: [PATCH] [clang][NFC] declar

[clang] [clang][NFC] declare internal linkage function static (PR #108759)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108759 >From cf770d55592adb41d072caa5f1aca7cd739d6e2b Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 15 Sep 2024 21:18:01 +0800 Subject: [PATCH] [clang][NFC] declare internal linkage function static Detect

[clang-tools-extra] [clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (PR #108743)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108743 >From b81896cc8c5bef064b7ea3564c2ddd40948e49fb Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 15 Sep 2024 17:00:35 +0800 Subject: [PATCH 1/2] [clang-tidy] fix false positive when member initializati

[clang-tools-extra] [clang-tidy] fix false positive that floating point variable only used in increment expr in cert-flp30-c (PR #108706)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108706 >From 9fbbc1821c41a75a3a606f4a8bb0a7c43fe9dee3 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 14 Sep 2024 23:25:36 +0800 Subject: [PATCH 1/2] [clang-tidy] fix false positive that floating point vari

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108555 >From 35742b5f2f085b8f6626456cd0d21ebecbe8f831 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Sep 2024 23:11:51 +0800 Subject: [PATCH 1/4] [clang-tidy]suggest use `std::span` as replacement of c

[clang-tools-extra] [clang-tidy] fix false positive when member initialization depends on structured binging variable in cppcoreguidelines-prefer-member-initializer (PR #108743)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/108743 ___ 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 positive that floating point variable only used in increment expr in cert-flp30-c (PR #108706)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108706 >From 9fbbc1821c41a75a3a606f4a8bb0a7c43fe9dee3 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 14 Sep 2024 23:25:36 +0800 Subject: [PATCH 1/2] [clang-tidy] fix false positive that floating point vari

[clang-tools-extra] [clang-tidy] fix false positive that floating point variable only used in increment expr in cert-flp30-c (PR #108706)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/108706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108555 >From 35742b5f2f085b8f6626456cd0d21ebecbe8f831 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Sep 2024 23:11:51 +0800 Subject: [PATCH 1/4] [clang-tidy]suggest use `std::span` as replacement of c

[clang] [clang][NFC] declare internal linkage function static (PR #108759)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108759 >From 302ccaa637dd99981fd299fdaafec739c39827bd Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 15 Sep 2024 21:18:01 +0800 Subject: [PATCH] [clang][NFC] declare internal linkage function static Detect

[clang] [clang][NFC] declare internal linkage function static (PR #108759)

2024-09-15 Thread Congcong Cai via cfe-commits
@@ -12,6 +12,7 @@ // //===--===// +#include "Move.h" HerrCai0907 wrote: It is not unrelated. `::clang::ento::move::isMovedFrom` has declaration in "Move.h" but since missing this header, It

[clang-tools-extra] [clang-tidy] insert ``static`` keyword in correct position for misc-use-internal-linkage (PR #108792)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/108792 Fixes: #108760 >From 795b3ae677210ff50f7710a0cf73d435889b68ae Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 16 Sep 2024 13:47:10 +0800 Subject: [PATCH] [clang-tidy] insert ``static`` keyword in co

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108555 >From 35742b5f2f085b8f6626456cd0d21ebecbe8f831 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Sep 2024 23:11:51 +0800 Subject: [PATCH 1/4] [clang-tidy]suggest use `std::span` as replacement of c

[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

2024-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108555 >From 35742b5f2f085b8f6626456cd0d21ebecbe8f831 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Sep 2024 23:11:51 +0800 Subject: [PATCH 1/5] [clang-tidy]suggest use `std::span` as replacement of c

[clang] [clang][NFC] declare internal linkage function static (PR #108759)

2024-09-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/108759 ___ 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 nullptr dereference in bugprone-forwarding-reference (PR #106856)

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

[clang] [ast-matcher] Fixed a crash when traverse lambda expr with invalid captures (PR #108689)

2024-09-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108689 >From af8720ade42fef1571b59e2ca21943abc6b998d1 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 14 Sep 2024 15:38:11 +0800 Subject: [PATCH 1/2] [ast-matcher] Fixed a crash when traverse lambda expr wi

[clang-tools-extra] [clang-tidy] insert ``static`` keyword in correct position for misc-use-internal-linkage (PR #108792)

2024-10-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108792 >From 795b3ae677210ff50f7710a0cf73d435889b68ae Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 16 Sep 2024 13:47:10 +0800 Subject: [PATCH 1/2] [clang-tidy] insert ``static`` keyword in correct positi

[clang] [clang] use ArrayTypeTraitExpr::getType as value type (PR #113186)

2024-10-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/113186 Fixed: #113044 >From 938de3d98db4b8e784cb7ec12b940e686ba1f304 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 21 Oct 2024 23:49:04 +0800 Subject: [PATCH] [clang] use ArrayTypeTraitExpr::getType as v

[clang] [clang] use ArrayTypeTraitExpr::getType as value type (PR #113186)

2024-10-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/113186 >From 938de3d98db4b8e784cb7ec12b940e686ba1f304 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 21 Oct 2024 23:49:04 +0800 Subject: [PATCH] [clang] use ArrayTypeTraitExpr::getType as value type Fixed:

[clang] [clang] use ArrayTypeTraitExpr::getType as value type (PR #113186)

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

[clang] [clang] use ArrayTypeTraitExpr::getType as value type (PR #113186)

2024-10-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/113186 >From 938de3d98db4b8e784cb7ec12b940e686ba1f304 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 21 Oct 2024 23:49:04 +0800 Subject: [PATCH 1/2] [clang] use ArrayTypeTraitExpr::getType as value type Fi

[clang] [clang codegen] fix crash emitting __array_rank (PR #113186)

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

[clang-tools-extra] [clang-tidy] insert ``static`` keyword in correct position for misc-use-internal-linkage (PR #108792)

2024-10-17 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108792 >From 795b3ae677210ff50f7710a0cf73d435889b68ae Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 16 Sep 2024 13:47:10 +0800 Subject: [PATCH 1/3] [clang-tidy] insert ``static`` keyword in correct positi

[clang-tools-extra] [clang-tidy] support `return c ? a : b;` in bugprone-return-const-ref-from-parameter (PR #107657)

2024-10-03 Thread Congcong Cai via cfe-commits
@@ -15,20 +16,24 @@ using namespace clang::ast_matchers; namespace clang::tidy::bugprone { void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher( - returnStmt( - hasReturnValue(declRefExpr( - to(parmVarD

[clang] [clang codegen] avoid to crash when emit init func for global variable with flexible array init (PR #113336)

2024-10-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/113336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang codegen] avoid to crash when emit init func for global variable with flexible array init (PR #113336)

2024-10-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/113336 Fixes: #113187 Avoid to create init function since clang does not support global variable with flexible array init. It will cause assertion failure later. >From ac8916ceba73bd223527fcb89c45ee4a8fdb9b5b Mon

[clang] [clang codegen] fix crash emitting __array_rank (PR #113186)

2024-10-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/113186 ___ 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] Replace usages of `DeclSpec::TQ` with `Qualifiers::TQ` (PR #113295)

2024-10-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM. thanks! https://github.com/llvm/llvm-project/pull/113295 ___ 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 positive for implicit conversion of comparison result in C23 (PR #113639)

2024-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/113639 Fixed #111013 bool will be builtin type in C23 but comparison result in C is still int. It is no need to change this kind of implicit cast to explicit cast. >From 53ff1325281e37b164abc8705f2d75d7caeec3a4 Mo

[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-25 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,168 @@ +//===--- UseIntegerSignComparisonCheck.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] Create a check for signed and unsigned integers comparison (PR #113144)

2024-10-24 Thread Congcong Cai via cfe-commits
@@ -117,18 +119,18 @@ void UseIntegerSignComparisonCheck::check( if (BinaryOp == nullptr) return; - auto OpCode = BinaryOp->getOpcode(); - const auto *LHS = BinaryOp->getLHS()->IgnoreParenImpCasts(); - const auto *RHS = BinaryOp->getRHS()->IgnoreParenImpCasts(); - if

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-designated-initializers check (PR #113688)

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

[clang] [sema] enhance error handling for compound stmt body in `StmtExpr` (PR #113760)

2024-10-29 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/113760 >From 1ea7857b255f9a260ece14891f4a3a423468a605 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 26 Oct 2024 21:19:04 +0800 Subject: [PATCH 1/2] [sema] enhance error handling for compound stmt body in

[clang] [sema] enhance error handling for compound stmt body in `StmtExpr` (PR #113760)

2024-10-29 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/113760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][sema] Fixed a crash when mixture of designated and non-designated initializers in union (PR #114424)

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

[clang-tools-extra] [clang-tidy] Stop linking against clangSema (PR #113373)

2024-10-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/113373 ___ 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 positive for implicit conversion of comparison result in C23 (PR #113639)

2024-10-27 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/113639 ___ 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 positive for implicit conversion of comparison result in C23 (PR #113639)

2024-10-27 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/113639 >From 53ff1325281e37b164abc8705f2d75d7caeec3a4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 25 Oct 2024 11:07:14 +0800 Subject: [PATCH 1/2] [clang-tidy] fix false positive for implicit conversion

[clang-tools-extra] [clang-tidy] support `return c ? a : b;` in bugprone-return-const-ref-from-parameter (PR #107657)

2024-10-27 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/107657 ___ 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 bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

2024-11-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/115275 >From 06fb72b3720e3c457fc672c38258474879006682 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 7 Nov 2024 15:21:48 +0800 Subject: [PATCH 1/3] [clang-tidy] fix bugprone-sizeof-expression when sizeof e

[clang-tools-extra] [clang-tidy] fix bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

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

[clang] [sema] enhance error handling for compound stmt body in `StmtExpr` (PR #113760)

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

[clang] [sema] enhance error handling for compound stmt body in `StmtExpr` (PR #113760)

2024-10-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/113760 Mark the whole StmtExpr invalid when the last statement in compound statement is invalid. Because the last statement need to do copy initialization, it causes subsequent errors to simply ignore last invalid

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/115180 >From 428283c7b61ca50d40ffd3ddc5c08aca39f39533 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 7 Nov 2024 00:35:47 +0800 Subject: [PATCH] [clang-tidy] fix false positive when detecting templated clas

[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

2024-11-13 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping @5chmidti @PiotrZSL https://github.com/llvm/llvm-project/pull/115180 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][sema] Fixed a crash when mixture of designated and non-designated initializers in union (PR #114424)

2024-10-31 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/114424 >From 0e4dd975f2139243bebdffe53aa9fde39a734730 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 1 Nov 2024 00:13:59 +0800 Subject: [PATCH] [clang][sema] Fixed a crash when mixture of designated and no

[clang] [clang][sema] Fixed a crash when mixture of designated and non-designated initializers in union (PR #114424)

2024-10-31 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/114424 Fixed: #113855 When the first init element is invalid, StructuredList can be empty. It cause illegal state if we still set initialized field. >From 0e4dd975f2139243bebdffe53aa9fde39a734730 Mon Sep 17 00:00:

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

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

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-08 Thread Congcong Cai via cfe-commits
@@ -139,6 +139,14 @@ CtorInitializerListTest::CtorInitializerListTest(float) try : exc(RegularExcepti RegularException(); } +// https://github.com/llvm/llvm-project/issues/115055 +class CtorInitializerListTest2 { + public: + CtorInitializerListTest2(){} He

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-08 Thread Congcong Cai via cfe-commits
@@ -139,6 +139,14 @@ CtorInitializerListTest::CtorInitializerListTest(float) try : exc(RegularExcepti RegularException(); } +// https://github.com/llvm/llvm-project/issues/115055 HerrCai0907 wrote: use a namspace GH (issue number) https://github.com/

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

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

[clang] [clang-tools-extra] [analyzer] Remove alpha.core.IdenticalExpr Checker (PR #114715)

2024-11-08 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: looks good. it extends the checker in clang-tidy so i think documents and releasenote in clang-tidy are also needed https://github.com/llvm/llvm-project/pull/114715 ___ cfe-commits mailing list cfe-commits@lis

[clang-tools-extra] [clang-tidy][NFC] add qutation mark for C++ classes in warning message (PR #109068)

2024-09-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109068 >From 66be189c281db7a49c5238c2fe09df64842c1e25 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 17 Sep 2024 23:01:17 +0800 Subject: [PATCH 1/2] add quotation --- .../modernize/AvoidCArraysCheck.cpp

[clang-tools-extra] [clang-tidy] insert ``static`` keyword in correct position for misc-use-internal-linkage (PR #108792)

2024-09-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108792 >From 795b3ae677210ff50f7710a0cf73d435889b68ae Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 16 Sep 2024 13:47:10 +0800 Subject: [PATCH] [clang-tidy] insert ``static`` keyword in correct position f

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

2024-09-22 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109431 >From 4f2fe989bc8206e4d7f81e21b6d171b85a4dd39b Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 22 Sep 2024 23:35:24 +0800 Subject: [PATCH] refix --- clang/lib/CodeGen/CGBuiltin.cpp | 9

[clang-tools-extra] Add clang-tidy external examples (PR #106675)

2024-09-23 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: You can add `toctree` in `clang-tools-extra/docs/clang-tidy/index.rst` example commit: https://reviews.llvm.org/D54945 https://github.com/llvm/llvm-project/pull/106675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [clang][NFC] add static for internal linkage function (PR #109436)

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

[clang] [clang][NFC] add static for internal linkage function (PR #109436)

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

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

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

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

2024-09-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/109431 ___ 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 static analyzer checker configuration in `--verify-config` (PR #109523)

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

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109302 >From cc2c798193722b3a537c76e74981ff767d064efa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 19 Sep 2024 23:46:16 +0800 Subject: [PATCH 1/4] [clang-tidy][bugprone-posix-return] support integer lite

[clang-tools-extra] [clang-tidy] insert ``static`` keyword in correct position for misc-use-internal-linkage (PR #108792)

2024-09-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/108792 >From 795b3ae677210ff50f7710a0cf73d435889b68ae Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 16 Sep 2024 13:47:10 +0800 Subject: [PATCH] [clang-tidy] insert ``static`` keyword in correct position f

[clang-tools-extra] [clang-tidy] loop convert can handle lambda init capture (PR #109159)

2024-09-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109159 >From 4fc1d24c4ff22a8da22454aebe7053ea76419767 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 18 Sep 2024 23:26:02 +0800 Subject: [PATCH] [clang-tidy] loop convert can handle lambda init capture Fix

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-26 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109302 >From cc2c798193722b3a537c76e74981ff767d064efa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 19 Sep 2024 23:46:16 +0800 Subject: [PATCH 1/5] [clang-tidy][bugprone-posix-return] support integer lite

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/109302 ___ 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] optimize unused using decls performance (PR #110200)

2024-09-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/110200 None >From aee3cc16d9c36d2cc56247ec14f72730c7b65e80 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 26 Sep 2024 17:48:48 +0800 Subject: [PATCH] [clang-tidy][NFC] optimize unused using decls performan

[clang-tools-extra] [clang-tidy][NFC] optimize unused using decls performance (PR #110200)

2024-09-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/110200 ___ 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] optimize unused using decls performance (PR #110200)

2024-09-28 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/110200 >From aee3cc16d9c36d2cc56247ec14f72730c7b65e80 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 26 Sep 2024 17:48:48 +0800 Subject: [PATCH 1/2] [clang-tidy][NFC] optimize unused using decls performance

[clang-tools-extra] [clang-tidy][NFC] optimize unused using decls performance (PR #110200)

2024-09-28 Thread Congcong Cai via cfe-commits
@@ -25,6 +25,13 @@ AST_MATCHER_P(DeducedTemplateSpecializationType, refsToTemplatedDecl, return false; } +AST_MATCHER_P(Type, getTagDecl, clang::ast_matchers::internal::Matcher, + DeclMatcher) { + if (const auto *ND = Node.getAsTagDecl()) Her

[clang] [clang-tools-extra] [clang-tidy] Fix performance-unnecessary-value-param (PR #109145)

2024-09-18 Thread Congcong Cai via cfe-commits
@@ -118,10 +118,19 @@ class FunctionParmMutationAnalyzer { static FunctionParmMutationAnalyzer * getFunctionParmMutationAnalyzer(const FunctionDecl &Func, ASTContext &Context, ExprMutationAnalyzer::Memoized &Memorized) { -auto [it, Ins

[clang] [clang-tools-extra] [clang-tidy] Fix performance-unnecessary-value-param (PR #109145)

2024-09-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/109145 ___ 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 performance-unnecessary-value-param (PR #109145)

2024-09-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM. The comment is a little bit hard to understand. maybe you can sort out the wording. https://github.com/llvm/llvm-project/pull/109145 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang-tools-extra] 11b95de - [clang-tidy][NFC] fix typo in clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp

2024-09-18 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-09-18T21:51:14+08:00 New Revision: 11b95deab9a00d53e94a089b5d4bf3c05e5d5370 URL: https://github.com/llvm/llvm-project/commit/11b95deab9a00d53e94a089b5d4bf3c05e5d5370 DIFF: https://github.com/llvm/llvm-project/commit/11b95deab9a00d53e94a089b5d4bf3c05e5d5370.diff

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

2024-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/109431 Detect by misc-use-internal-linkage >From cc42a41300c3acb202635902e6746061e09e7114 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Sep 2024 22:27:28 +0800 Subject: [PATCH] [codegen][NFC] add stat

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

2024-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109431 >From d6eae7c4543e081f3a7d2e8bd33d11082c7e06cb Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Sep 2024 22:27:28 +0800 Subject: [PATCH] [codegen][NFC] add static mark for internal usage variable a

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

2024-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109431 >From fdca1726b8fe9d60407e48426a513eebb81a710e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Sep 2024 22:27:28 +0800 Subject: [PATCH] [codegen][NFC] add static mark for internal usage variable a

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109302 >From cc2c798193722b3a537c76e74981ff767d064efa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 19 Sep 2024 23:46:16 +0800 Subject: [PATCH 1/3] [clang-tidy][bugprone-posix-return] support integer lite

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109302 >From cc2c798193722b3a537c76e74981ff767d064efa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 19 Sep 2024 23:46:16 +0800 Subject: [PATCH 1/2] [clang-tidy][bugprone-posix-return] support integer lite

[clang] [codegen][NFC] add static mark for internal usage variable and function (PR #109431)

2024-09-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/109431 >From fdca1726b8fe9d60407e48426a513eebb81a710e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Sep 2024 22:27:28 +0800 Subject: [PATCH 1/2] [codegen][NFC] add static mark for internal usage variab

[clang-tools-extra] [clang-tidy][readability-container-contains] Use hasOperands when possible (PR #109178)

2024-09-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/109178 ___ 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-nullptr matches "NULL" in templates (PR #109169)

2024-09-20 Thread Congcong Cai via cfe-commits
@@ -38,7 +38,9 @@ AST_MATCHER(Type, sugaredNullptrType) { StatementMatcher makeCastSequenceMatcher(llvm::ArrayRef NameList) { auto ImplicitCastToNull = implicitCastExpr( anyOf(hasCastKind(CK_NullToPointer), hasCastKind(CK_NullToMemberPointer)), - unless(hasImplic

<    2   3   4   5   6   7   8   9   10   11   >