[clang-tools-extra] [clang-tidy] Add bugprone-chained-comparison check (PR #76365)

2024-01-15 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,161 @@ +//===--- ChainedComparisonCheck.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:

[clang-tools-extra] [clang-tidy] Add bugprone-chained-comparison check (PR #76365)

2024-01-15 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,161 @@ +//===--- ChainedComparisonCheck.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:

[clang-tools-extra] [clang-tidy] Add bugprone-chained-comparison check (PR #76365)

2024-01-15 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,161 @@ +//===--- ChainedComparisonCheck.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:

[clang-tools-extra] [NFC][clang-tidy]improve performance for misc-unused-using-decls check (PR #78231)

2024-01-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/78231 `UnusedUsingDeclsCheck::removeFromFoundDecls` will be called with high frequency. At current time it will check every `Context`. This patch adds a cache to reduce algorithm complexity. >From

[clang] [clang-tools-extra] [lld] [compiler-rt] [llvm] [lldb] [flang] [libcxx] [mlir] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-15 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,52 @@ +//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===// HerrCai0907 wrote: fixed in 10602c2b4a662872d1aaeda1dbc58e5d6f613fda https://github.com/llvm/llvm-project/pull/78022 ___

[clang-tools-extra] 10602c2 - [NFC]add - at the beginning for alignment

2024-01-15 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-01-16T07:49:07+08:00 New Revision: 10602c2b4a662872d1aaeda1dbc58e5d6f613fda URL: https://github.com/llvm/llvm-project/commit/10602c2b4a662872d1aaeda1dbc58e5d6f613fda DIFF: https://github.com/llvm/llvm-project/commit/10602c2b4a662872d1aaeda1dbc58e5d6f613fda.diff

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/77943 >From 537d283288f555c2bb7cff90aee89fe9b18f08b8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 13 Jan 2024 00:31:33 +0800 Subject: [PATCH 1/4] [clang-tid]fix modernize-use-auto incorrect fix hints for

[compiler-rt] [clang-tools-extra] [lld] [clang] [lldb] [libcxx] [llvm] [mlir] [flang] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

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

[llvm] [lldb] [libcxx] [clang-tools-extra] [clang] [lld] [flang] [mlir] [compiler-rt] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/78022 >From 0988bb25a35e5d50b44bf53d459098777280c3e5 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 13 Jan 2024 16:00:16 +0800 Subject: [PATCH 1/3] [clang-tidy]Add new check

[flang] [clang] [clang-tools-extra] [llvm] [compiler-rt] [mlir] [lld] [libcxx] [lldb] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/78022 >From 0988bb25a35e5d50b44bf53d459098777280c3e5 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 13 Jan 2024 16:00:16 +0800 Subject: [PATCH 1/2] [clang-tidy]Add new check

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/78022 >From 0988bb25a35e5d50b44bf53d459098777280c3e5 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 13 Jan 2024 16:00:16 +0800 Subject: [PATCH 1/2] [clang-tidy]Add new check

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,56 @@ +//===--- AvoidNestedConditionalOperatorCheck.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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,56 @@ +//===--- AvoidNestedConditionalOperatorCheck.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:

[clang-tools-extra] [clang-tidy]fix readability-implicit-bool-conversion false-positives when comparison bool bitfield (PR #77878)

2024-01-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/77878 ___ 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 readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/78022 Finds nested conditional operator. Nested conditional operators lead code hard to understand, so they should be splited as several statement and stored in temporary varibale. >From

[clang-tools-extra] 5ca2d75 - [NFC]fix incorrect autosar link in clang-tidy doc

2024-01-12 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-01-13T08:09:36+08:00 New Revision: 5ca2d75f2046612978ba71c4b36714b2a0a01886 URL: https://github.com/llvm/llvm-project/commit/5ca2d75f2046612978ba71c4b36714b2a0a01886 DIFF: https://github.com/llvm/llvm-project/commit/5ca2d75f2046612978ba71c4b36714b2a0a01886.diff

[clang-tools-extra] e028bee - [NFC]update autosar link in clang-tidy doc

2024-01-12 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-01-13T08:08:11+08:00 New Revision: e028bee52ffc2ab9883d3d9a7dc66fe7b7c50a65 URL: https://github.com/llvm/llvm-project/commit/e028bee52ffc2ab9883d3d9a7dc66fe7b7c50a65 DIFF: https://github.com/llvm/llvm-project/commit/e028bee52ffc2ab9883d3d9a7dc66fe7b7c50a65.diff

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Congcong Cai via cfe-commits
@@ -405,12 +421,20 @@ void UseAutoCheck::replaceExpr( auto Diag = diag(Range.getBegin(), Message); + bool ShouldReplenishVariableName = isMutliLevelPointerToTypeLocClasses( + FirstDecl->getTypeSourceInfo()->getTypeLoc(), + {TypeLoc::FunctionProto,

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/77943 >From 537d283288f555c2bb7cff90aee89fe9b18f08b8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 13 Jan 2024 00:31:33 +0800 Subject: [PATCH 1/3] [clang-tid]fix modernize-use-auto incorrect fix hints for

[clang-tools-extra] [clang-tidy] Fix false-positives in misc-static-assert caused by non-constexpr variables (PR #77203)

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

[clang-tools-extra] [clang-tid]fix modernize-use-auto incorrect fix hints for pointer (PR #77943)

2024-01-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/77943 avoid create incorrect fix hints for pointer to array type and pointer to function type Fixes: #77891 >From 537d283288f555c2bb7cff90aee89fe9b18f08b8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat,

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2024-01-12 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,200 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s readability-redundant-casting %t +// RUN: %check_clang_tidy -std=c++11-or-later -check-suffix=,MACROS %s readability-redundant-casting %t -- \ +// RUN: -config='{CheckOptions: {

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2024-01-12 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,242 @@ +//===--- RedundantCastingCheck.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:

[clang-tools-extra] [clang-tidy]fix readability-implicit-bool-conversion false-positives when comparison bool bitfield (PR #77878)

2024-01-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/77878 Fixes: #76817 For ignoring comparison and xor operator, it needs to use ImplicitCastFromBool without ignoring exception cases. This patch splits ignoring exception cases logic from ImplicitCastFromBool and

[clang] [clang]not lookup name containing a dependent type (PR #77587)

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

[clang] [clang]not lookup name containing a dependent type (PR #77587)

2024-01-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/77587 >From f6b9afa26fabb5f9dcea5615c92914bed93ef474 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 10 Jan 2024 19:27:31 +0800 Subject: [PATCH 1/2] [clang]not lookup name containing a dependent type

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,50 @@ +//===--- DonotreturnzerocheckCheck.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:

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,50 @@ +//===--- DonotreturnzerocheckCheck.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:

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,30 @@ +//===--- DonotreturnzerocheckCheck.h - clang-tidy ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

2024-01-10 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,50 @@ +//===--- DonotreturnzerocheckCheck.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:

[clang] [clang]not lookup name containing a dependent type (PR #77587)

2024-01-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/77587 Fixes: #77583 bcd51aaaf8bde4b0ae7a4155d9ce3dec78fe2598 fixed part of template instantiation dependent name issues but still missing some cases This patch want to enhance the dependent name check >From

[clang] [clang]use correct this scope to evaluate noexcept expr (PR #77416)

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

[clang] [clang]use correct this scope to evaluate noexcept expr (PR #77416)

2024-01-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/77416 >From 0637a482c881f5ce31fd1debbc8dcc40a05c66ba Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 9 Jan 2024 14:53:25 +0800 Subject: [PATCH 1/3] [clang]use correct this scope to evaluate noexcept expr

[clang] [clang]use correct this scope to evaluate noexcept expr (PR #77416)

2024-01-08 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/77416 Fixes: #77411 When substituting deduced type, noexcept expr in method should be instantiated and evaluated. ThisScrope should be switched to method context instead of origin sema context >From

[clang-tools-extra] [clang-tidy]unused using decls only check cpp files (PR #77335)

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

[clang-tools-extra] [clang-tidy]unused using decls only check cpp files (PR #77335)

2024-01-08 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/77335 >From 832bb78fd8cac372ec5560bb280f11e11be8d2e6 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 9 Jan 2024 00:41:33 +0800 Subject: [PATCH] [clang-tidy]unused using decls only check cpp files ---

[clang-tools-extra] [clang-tidy]unused using decls only check cpp files (PR #77335)

2024-01-08 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/77335 using decls can be used in cpp >From 39fae7adcdc97b4781911097f5f09c5bf8266d1c Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 9 Jan 2024 00:25:44 +0800 Subject: [PATCH] [clang-tidy]unused using decls

[clang] [clang-tools-extra] [clang-tidy] Improve performance of misc-const-correctness (PR #72705)

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

[clang] [clang]Transform uninstantiated ExceptionSpec in `TemplateInstantiator` (PR #77073)

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

[clang] [clang]Transform uninstantiated ExceptionSpec in `TemplateInstantiator` (PR #77073)

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

[clang] [clang]Transform uninstantiated ExceptionSpec in `TemplateInstantiator` (PR #77073)

2024-01-05 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/77073 Fixes: #77071 `SubstituteDeducedTypeTransform` will transform type and it will visit uninstantiated `ExceptionSpecInfo`, which will cause odd behavior >From 04ef8fd566491024c8163ad3b901f8c4cebaf890 Mon Sep

[clang-tools-extra] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

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

[clang] [clang]get non-injected-class before finding instantiated decl (PR #70886)

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

[clang-tools-extra] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

2023-12-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/75061 >From c3938da3a94ed9a9cc86d006d4b39dc5b73e7114 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 11 Dec 2023 23:32:32 +0800 Subject: [PATCH] [clang-tidy][misleading-indentation]ignore false-positives

[clang-tools-extra] [clang] [clang-tidy] Improve performance of misc-const-correctness (PR #72705)

2023-12-11 Thread Congcong Cai via cfe-commits
@@ -15,6 +15,76 @@ namespace clang { using namespace ast_matchers; +static bool canResolveToExprImpl(const Expr *Node, const Expr *Target) { + + const auto IgnoreDerivedToBase = [](const Expr *E, auto Matcher) { +if (Matcher(E)) + return true; +if (const auto

[clang] [clang-tools-extra] [clang-tidy] Improve performance of misc-const-correctness (PR #72705)

2023-12-11 Thread Congcong Cai via cfe-commits
@@ -15,6 +15,76 @@ namespace clang { using namespace ast_matchers; +static bool canResolveToExprImpl(const Expr *Node, const Expr *Target) { HerrCai0907 wrote: This function is hard to understand because it used matcher style naming but logic operator style

[clang] [clang-tools-extra] [clang-tidy] Improve performance of misc-const-correctness (PR #72705)

2023-12-11 Thread Congcong Cai via cfe-commits
@@ -15,6 +15,76 @@ namespace clang { using namespace ast_matchers; +static bool canResolveToExprImpl(const Expr *Node, const Expr *Target) { + + const auto IgnoreDerivedToBase = [](const Expr *E, auto Matcher) { +if (Matcher(E)) + return true; +if (const auto

[clang-tools-extra] [clang-tidy][misleading-indentation]ignore false-positives for line started with empty macro (PR #75061)

2023-12-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/75061 Fixes: #71767 >From e710a0568c73e87296b4df03ac6746766bd87c3a Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 11 Dec 2023 23:32:32 +0800 Subject: [PATCH] [clang-tidy][misleading-indentation]ignore

[clang-tools-extra] [clang-tidy][NFC][DOC] Add missing HICPP rule id's (PR #72553)

2023-11-17 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/72553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

2023-11-08 Thread Congcong Cai via cfe-commits
@@ -23,6 +23,10 @@ namespace clang::tidy::performance { namespace { +AST_MATCHER(EnumDecl, hasEnumerators) { + return Node.enumerator_begin() != Node.enumerator_end(); HerrCai0907 wrote: ```suggestion return !Node.enumerators().empty(); ```

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

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

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

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

[clang] [clang]get non-injected-class before finding instantiated decl (PR #70886)

2023-11-06 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: ping @erichkeane @AaronBallman @shafik @cor3ntin https://github.com/llvm/llvm-project/pull/70886 ___ 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 modernize-make-shared check (PR #70600)

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

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

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

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/71006 >From 69b7688f56f7fe96031201eef1c3804f391c5abe Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 Nov 2023 08:49:22 +0800 Subject: [PATCH 1/2] [NFC][clang-tidy]refactor isAssignmentToMemberOf in

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-01 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/71006 isAssignmentToMemberOf will return `std::make_pair(nullptr, nullptr)` when failed. Using `std::optional` can describe failed case clearly. >From 69b7688f56f7fe96031201eef1c3804f391c5abe Mon Sep 17 00:00:00

[clang] [clang]get non-injected-class before finding instantiated decl (PR #70886)

2023-11-01 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/70886 >From 73471336857b84c69e51d4561838e588c7162bfa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 31 Oct 2023 17:27:35 +0800 Subject: [PATCH 1/3] [clang]get non-injected-class before finding instantiated

[clang] [clang]get non-injected-class before finding instantiated decl (PR #70886)

2023-11-01 Thread Congcong Cai via cfe-commits
@@ -429,3 +429,19 @@ namespace qualified_friend_no_match { friend void Y::f(double); // expected-error {{friend declaration of 'f' does not match any declaration in 'qualified_friend_no_match::Y'}} }; } + +namespace gh21483 { +template +struct B { + struct mixin { +

[clang] [clang]get non-injected-class before finding instantiated decl (PR #70886)

2023-10-31 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/70886 Fixes #21483 >From 73471336857b84c69e51d4561838e588c7162bfa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 31 Oct 2023 17:27:35 +0800 Subject: [PATCH 1/2] [clang]get non-injected-class before

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-trailing-return-type (PR #70709)

2023-10-30 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/70709 ___ 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 crash in modernize-use-trailing-return-type (PR #70709)

2023-10-30 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM except release note https://github.com/llvm/llvm-project/pull/70709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][test] Add more bugprone-string-constructor tests (PR #70456)

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

[clang] [clang]set invalid for lambda which missing capture `this` (PR #70432)

2023-10-27 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/70432 It can suppression further crash. Fixes: #67687 >From c12aeb6f2a83b9cb3c3815e72d57638cf7de43a0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 27 Oct 2023 16:51:59 +0800 Subject: [PATCH] WIP fix

[clang-tools-extra] [clang-tidy]Fix PreferMemberInitializer false positive for reassignment (PR #70316)

2023-10-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/70316 >From 41278ca046ae5d4be4ac4ac1bc673b5010668d9c Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 26 Oct 2023 18:54:05 +0800 Subject: [PATCH 1/2] [clang-tidy]Fix PreferMemberInitializer false positive

[clang-tools-extra] [clang-tidy]Fix PreferMemberInitializer false positive for reassignment (PR #70316)

2023-10-26 Thread Congcong Cai via cfe-commits
@@ -570,3 +570,19 @@ struct PR52818 { int bar; }; + +struct RefReassignment { + RefReassignment(int ) : m_i{i} { +m_i = 1; + } + int & m_i; +}; + +struct ReassignmentAfterUnsafetyAssignment { + ReassignmentAfterUnsafetyAssignment() { +int a = 10; +m_i =

[clang-tools-extra] [clang-tidy]Fix PreferMemberInitializer false positive for reassignment (PR #70316)

2023-10-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/70316 - assignment twice cannot be simplified to once when assigning to reference type - safe assignment cannot be advanced before unsafe assignment >From 41278ca046ae5d4be4ac4ac1bc673b5010668d9c Mon Sep 17

[clang-tools-extra] [clang-tidy] Improve bugprone-unused-return-value check (PR #66573)

2023-10-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/66573 ___ 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 StrictMode to cppcoreguidelines-pro-type-static-cast-downcast (PR #69529)

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

[clang-tools-extra] f5063bf - [clang-tidy][NFC]refactor PreferMemberInitializerCheck for readability

2023-10-25 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2023-10-26T13:37:50+08:00 New Revision: f5063bf7edbb6368deb7354b4340eb62b8329d2e URL: https://github.com/llvm/llvm-project/commit/f5063bf7edbb6368deb7354b4340eb62b8329d2e DIFF: https://github.com/llvm/llvm-project/commit/f5063bf7edbb6368deb7354b4340eb62b8329d2e.diff

[clang-tools-extra] [clang-tidy]fix misc-unused-using-decls false positive false for using in elaborated type (PR #70230)

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

[clang-tools-extra] [clang-tidy] Improved cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes (PR #69242)

2023-10-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/69242 ___ 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 StrictMode to cppcoreguidelines-pro-type-static-cast-downcast (PR #69529)

2023-10-25 Thread Congcong Cai via cfe-commits
@@ -14,3 +14,11 @@ unrelated type ``Z``. This rule is part of the `Type safety (Type.2) `_ profile from the C++ Core Guidelines. + +Options +--- + +.. option:: StrictMode + + When set to

[clang-tools-extra] [clang-tidy] Support functional cast in bugprone-dangling-handle (PR #69067)

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

[clang-tools-extra] [clang-tidy] Improved cppcoreguidelines-pro-type-const-cast (PR #69501)

2023-10-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/69501 ___ 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 misc-unused-using-decls false positive false for using in elaborated type (PR #70230)

2023-10-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/70230 >From 7ba5e132f50730b9e9cb392df7a2756066a7e909 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 23 Oct 2023 09:00:26 +0800 Subject: [PATCH 1/2] [clang-tidy]fix misc-unused-using-decls false positive

[clang-tools-extra] [clang-tidy]fix misc-unused-using-decls false positive false for using in elaborated type (PR #70230)

2023-10-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/70230 `ElaboratedType` including tag keywords and any nested-name-specifiers. We should ignore nested-name-specifiers case but consider tag keywords case for `misc-unused-using-decls` check Fixes: #69714 >From

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

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

[clang-tools-extra] [clang-tidy] Ignore deleted functions in cppcoreguidelines-rvalue-reference-param-not-moved (PR #69514)

2023-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/69514 ___ 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-unused-return-value check (PR #66573)

2023-10-24 Thread Congcong Cai via cfe-commits
@@ -130,26 +130,35 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, "::std::error_condition;" "::std::errc;"

[clang-tools-extra] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

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

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

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

[clang-tools-extra] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-24 Thread Congcong Cai via cfe-commits
@@ -455,6 +455,10 @@ Bug Fixes in This Version cannot be used with ``Release`` mode builds. (`#68237 `_). - Fix crash in evaluating ``constexpr`` value for invalid template function. Fixes (`#68542

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-24 Thread Congcong Cai via cfe-commits
@@ -455,6 +455,10 @@ Bug Fixes in This Version cannot be used with ``Release`` mode builds. (`#68237 `_). - Fix crash in evaluating ``constexpr`` value for invalid template function. Fixes (`#68542

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/69688 >From 2629b346123f9838a4fc3d8b6fb6a98508773965 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Oct 2023 15:45:42 +0800 Subject: [PATCH 1/2] [clang]improve diagnosing redefined defaulted constructor

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/68878 >From b93096929aa98e17dfdb0240a9285d315fc95bfc Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Oct 2023 19:31:08 +0800 Subject: [PATCH 1/4] [clang]Transform uninstantiated ExceptionSpec in

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 deleted https://github.com/llvm/llvm-project/pull/69688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-24 Thread Congcong Cai via cfe-commits
@@ -378,7 +381,6 @@ Improvements to Clang's diagnostics C++ semantics, e.g. which function template is more specialized. This can sometimes lead to worse ordering. - HerrCai0907 wrote: ```suggestion ``` https://github.com/llvm/llvm-project/pull/69688

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/68878 >From b93096929aa98e17dfdb0240a9285d315fc95bfc Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 12 Oct 2023 19:31:08 +0800 Subject: [PATCH 1/3] [clang]Transform uninstantiated ExceptionSpec in

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/69688 >From 2629b346123f9838a4fc3d8b6fb6a98508773965 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Oct 2023 15:45:42 +0800 Subject: [PATCH 1/2] [clang]improve diagnosing redefined defaulted constructor

[clang] [clang]Transform uninstantiated ExceptionSpec in TemplateInstantiator (PR #68878)

2023-10-24 Thread Congcong Cai via cfe-commits
@@ -396,6 +396,10 @@ Bug Fixes in This Version cannot be used with ``Release`` mode builds. (`#68237 `_). - Fix crash in evaluating ``constexpr`` value for invalid template function. Fixes (`#68542

[clang] [NFC] use `StringSet::insert(iter, iter)` instead for loop to insert (PR #69851)

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

[clang] [NFC] use `StringSet::insert(iter, iter)` instead for loop to insert (PR #69851)

2023-10-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/69851 None >From 37f6822035845f120d2fb995a607561621c3892e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sun, 22 Oct 2023 00:27:04 +0800 Subject: [PATCH] [NFC] use `StringSet::insert(iter, iter)` instead for

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/69688 >From 2629b346123f9838a4fc3d8b6fb6a98508773965 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Oct 2023 15:45:42 +0800 Subject: [PATCH 1/2] [clang]improve diagnosing redefined defaulted constructor

[clang-tools-extra] [clang-tidy] Support functional cast in bugprone-dangling-handle (PR #69067)

2023-10-20 Thread Congcong Cai via cfe-commits
@@ -33,14 +33,19 @@ handleFrom(const ast_matchers::internal::Matcher , ast_matchers::internal::Matcher handleFromTemporaryValue( const ast_matchers::internal::Matcher ) { + + const auto TemporaryExpr = + anyOf(cxxBindTemporaryExpr(), +

[clang] [clang-tidy]Add new check bugprone-casting-through-void (PR #69465)

2023-10-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/69465 >From 627f68e57b2526fb72285ef4831fc3c02a6ee6d0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 18 Oct 2023 08:47:02 +0800 Subject: [PATCH 1/8] [clang-tidy]Add new check bugprone-casting-through-void

[clang-tools-extra] [clang-tidy]Add new check bugprone-casting-through-void (PR #69465)

2023-10-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/69465 >From 627f68e57b2526fb72285ef4831fc3c02a6ee6d0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 18 Oct 2023 08:47:02 +0800 Subject: [PATCH 1/8] [clang-tidy]Add new check bugprone-casting-through-void

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/69688 >From 2629b346123f9838a4fc3d8b6fb6a98508773965 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 20 Oct 2023 15:45:42 +0800 Subject: [PATCH] [clang]improve diagnosing redefined defaulted constructor

[clang] [clang]improve diagnosing redefined defaulted constructor with different exception specs (PR #69688)

2023-10-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/69688 It is misleading when diagnosing 'ExplicitlySpecialMethod' is missing exception specification 'noexcept' for ```c++ struct ExplicitlySpecialMethod { ExplicitlySpecialMethod() = default; };

[clang] [clang]Avoid to check created local variable multiple time when evaluating (PR #69106)

2023-10-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/69106 ___ 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   >