[clang-tools-extra] [clang] [llvm] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-02-04 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > You have an example of that? There may be further bugs there. > id-expression that appear in any unevaluated context should not be captured ( > typeid being an exception I think it is from standard, but from user-friendly site. Now clang will hint user some variables is no

[clang-tools-extra] [clang-tidy] Add AllowStringArrays option to modernize-avoid-c-arrays (PR #71701)

2024-01-25 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: I may not work for ```c++ void f(const char name[]); f("111"); ``` https://github.com/llvm/llvm-project/pull/71701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang-tools-extra] [llvm] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-01-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/78598 >From 8fa3dc43e770025308da47f6aff309fa58c47fc3 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 18 Jan 2024 23:12:23 +0800 Subject: [PATCH 1/3] [clang] reject to capture variable in `RequiresExprBodyDe

[clang-tools-extra] [clang-tidy] Add AllowStringArrays option to modernize-avoid-c-arrays (PR #71701)

2024-01-29 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > It should not work, as this is not array, but pointer Agree. But it fulfills the description of this opinion, since it looks like to construct a array from string literals. It would be better to explain it in document. > incomplete array types constructed from string liter

[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 o

[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: Ap

[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: { readability-redundant-casting.

[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, 13

[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 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-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, TypeLoc::Consta

[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] 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] [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 0988bb25a35e5d50b44bf53d45

[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-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: Apache-

[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: Apache-

[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 readability-avoid-nested-condit

[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 readability-avoid-nested-condit

[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 readability-avoid-nested-condit

[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

[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

[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] [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 ___ c

[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 ebd6f7648c7b4fee

[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: Ap

[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: Ap

[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: Ap

[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: Ap

[clang-tools-extra] [clang-tidy] Fixes to readability-implicit-bool-conversion (PR #72050)

2024-01-15 Thread Congcong Cai via cfe-commits
@@ -173,16 +173,30 @@ StringRef getEquivalentBoolLiteralForExpr(const Expr *Expression, return {}; } +bool needsSpacePrefix(SourceLocation Loc, ASTContext &Context) { + SourceRange PrefixRange(Loc.getLocWithOffset(-1), Loc); + StringRef SpaceBeforeStmtStr = Lexer::getSour

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

2024-01-16 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > Thanks, the code looks good. Do you have any performance data after this > change? I don't run clang-tidy bench for some large project. But I do some test for some auto-generated cpp file which has lots of using, and the execution time reduce from 0.2s to 0.18s in my MAC

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

2024-01-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/78231 ___ 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]improve performance for misc-unused-using-decls check (PR #78231)

2024-01-16 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > LGTM. There is open issue for performance of this check. Consider mentioning > this in release notes as some generic performance improvement. I have also seen this issue. But after optimization, this check is still slow. I guess registering too many pattern causes performa

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-01-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/78598 Expression in `RequiresExprBodyDecl` is resolved as constants and should not be captured. Fixes: #69307, #76593. >From 33db497c31fd9da3a3acfc0d419dcdc396752863 Mon Sep 17 00:00:00 2001 From: Congcong Cai Da

[clang-tools-extra] [clang-apply-replacements] Deduplicate Implementation of `collectReplacementsFromDirectory` (NFC) (PR #78630)

2024-01-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/78630 ___ 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-loop-convert when int is used as iterator (PR #78796)

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

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

2024-01-19 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

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-01-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/78598 >From 8fa3dc43e770025308da47f6aff309fa58c47fc3 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 18 Jan 2024 23:12:23 +0800 Subject: [PATCH 1/2] [clang] reject to capture variable in `RequiresExprBodyDe

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

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

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

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

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-01-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/78598 >From 8fa3dc43e770025308da47f6aff309fa58c47fc3 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 18 Jan 2024 23:12:23 +0800 Subject: [PATCH 1/3] [clang] reject to capture variable in `RequiresExprBodyDe

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-01-19 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > Thanks for the patch! > > Requires Expressions should be in an unevaluated context, so we should never > try to capture variables they mentioned. > > Maybe we need to test the evaluation context in either `tryCaptureVariable` > or `NeedToCaptureVariable`, rather than a sp

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

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

[clang] 0f80f5e - [NFC] fix typo in clang/include/clang/Sema/ScopeInfo.h

2024-01-20 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-01-20T22:43:15+08:00 New Revision: 0f80f5e362fb43a9335bd154c5f7976a96e32cfc URL: https://github.com/llvm/llvm-project/commit/0f80f5e362fb43a9335bd154c5f7976a96e32cfc DIFF: https://github.com/llvm/llvm-project/commit/0f80f5e362fb43a9335bd154c5f7976a96e32cfc.diff

[clang-tools-extra] [clang-tidy] Add support for lambdas in cppcoreguidelines-owning-memory (PR #77246)

2024-01-22 Thread Congcong Cai via cfe-commits
@@ -147,10 +161,52 @@ void OwningMemoryCheck::registerMatchers(MatchFinder *Finder) { // Matching on functions, that return an owner/resource, but don't declare // their return type as owner. Finder->addMatcher( - functionDecl(hasDescendant(returnStmt(hasReturnValue

[clang] [Clang][AST] fix crash in mangle lambda expression (PR #78896)

2024-01-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: Should it change the mangle part in libcxx also? https://github.com/llvm/llvm-project/pull/78896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

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

2023-10-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/69465 This check detects usage of ``static_cast`` pointer to the other pointer throght `static_cast` to `void *` in C++ code. Fixes: #68532 >From 627f68e57b2526fb72285ef4831fc3c02a6ee6d0 Mon Sep 17 00:00:00 2001 F

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

2023-10-18 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/2] [clang-tidy]Add new check bugprone-casting-through-void F

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

2023-10-18 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/2] [clang-tidy]Add new check bugprone-casting-through-void F

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

2023-10-18 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/2] [clang-tidy]Add new check bugprone-casting-through-void F

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

2023-10-18 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/4] [clang-tidy]Add new check bugprone-casting-through-void F

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

2023-10-18 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/5] [clang-tidy]Add new check bugprone-casting-through-void F

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

2023-10-18 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/6] [clang-tidy]Add new check bugprone-casting-through-void F

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

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

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

2023-10-18 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/7] [clang-tidy]Add new check bugprone-casting-through-void F

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

2023-10-18 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/2] [clang]Transform uninstantiated ExceptionSpec in Template

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

2023-10-18 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/2] [clang]Transform uninstantiated ExceptionSpec in Template

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

2023-10-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: friendly ping @erichkeane 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-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: friendly ping @erichkeane 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]Avoid to check created local variable multiple time when evaluating (PR #69106)

2023-10-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > I test example in branch llvmorg-16.0.6,ExprConstant.cpp also has this > assertion but it will not result in crash. Have you find the exact commit to break this case? @mzyKi https://github.com/llvm/llvm-project/pull/69106 ___ cf

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

2023-10-18 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 Template

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

2023-10-18 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: I think it would be better to disable assert instead of revert this change. 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-c

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

2023-10-19 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] Improved cppcoreguidelines-pro-type-const-cast (PR #69501)

2023-10-19 Thread Congcong Cai via cfe-commits
@@ -14,13 +14,42 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { +static bool hasConstQualifier(QualType Type) { + const QualType PtrType = Type->getPointeeType(); + if (!PtrType.isNull()) +return hasConstQualifier(PtrType); + + retur

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

2023-10-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited 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] Improved cppcoreguidelines-pro-type-const-cast (PR #69501)

2023-10-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited 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] Improved cppcoreguidelines-pro-type-const-cast (PR #69501)

2023-10-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited 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] Improved cppcoreguidelines-pro-type-const-cast (PR #69501)

2023-10-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited 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] Improved cppcoreguidelines-pro-type-const-cast (PR #69501)

2023-10-19 Thread Congcong Cai via cfe-commits
@@ -14,13 +14,42 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { +static bool hasConstQualifier(QualType Type) { + const QualType PtrType = Type->getPointeeType(); + if (!PtrType.isNull()) +return hasConstQualifier(PtrType); + + retur

[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

[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; }; ExplicitlySpecial

[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 wit

[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 F

[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 F

[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 &IsAHandle, ast_matchers::internal::Matcher handleFromTemporaryValue( const ast_matchers::internal::Matcher &IsAHandle) { + + const auto TemporaryExpr = + anyOf(cxxBindTemporaryExpr(), +

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

[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] [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] [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/3] [clang]Transform uninstantiated ExceptionSpec in Template

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

[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
@@ -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-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
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
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-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;" "::std::expec

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

[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 fa

[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] 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] 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 `fals

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

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