[clang-tools-extra] [Clang-Tidy][NFC] Simplify check cppcoreguidelines-missing-std-forward (PR #138504)

2025-05-05 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/138504 >From a972594f263865dc4d214591f6dc4f6f55b058db Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Mon, 5 May 2025 19:02:06 +0800 Subject: [PATCH 1/2] Simplify check cppcoreguidelines-missing-std-forward --- .../cla

[clang-tools-extra] [Clang-Tidy][NFC] Simplify check cppcoreguidelines-missing-std-forward (PR #138504)

2025-05-06 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: > Strange, can you explain why that's the case? `CaptureInCopy` matches lambda expressions whose default capture kind is copy and which have an explicit capture referencing function parameter. `CaptureByRefExplicit` matches lambda expressions which have an e

[clang-tools-extra] [Clang-Tidy][NFC] Simplify check cppcoreguidelines-missing-std-forward (PR #138504)

2025-05-06 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/138504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-28 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/134522 >From ccab3dc1f18ffeda9acb07c0bd5f80f65cc788b9 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Sun, 6 Apr 2025 15:06:56 +0800 Subject: [PATCH 1/2] Handle invalid variable template specialization whose type depend

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-29 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/134522 >From ccab3dc1f18ffeda9acb07c0bd5f80f65cc788b9 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Sun, 6 Apr 2025 15:06:56 +0800 Subject: [PATCH 1/3] Handle invalid variable template specialization whose type depend

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-29 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/134522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-29 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/134522 >From ccab3dc1f18ffeda9acb07c0bd5f80f65cc788b9 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Sun, 6 Apr 2025 15:06:56 +0800 Subject: [PATCH 1/3] Handle invalid variable template specialization whose type depend

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-03-09 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-03-09 Thread Yanzuo Liu via cfe-commits
@@ -8361,6 +8361,17 @@ class ExprEvaluatorBase return false; } +// If an assertion fails during constant evaluation, give a specific note explaining that +if (FD->getName() == "__assert_fail") { zwuis wrote: The name of corresponding func

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-03-09 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: Thank you for the patch! You should add a release note in clang/docs/ReleaseNotes.rst so that users can know the improvement. https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits

[clang] [Clang] Check for uninitialized use in lambda within CXXOperatorCallExpr (PR #129198)

2025-03-05 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis approved this pull request. https://github.com/llvm/llvm-project/pull/129198 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Add test for CWG2289 "Uniqueness of structured binding names" (PR #131054)

2025-03-12 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/131054 The resolution of [CWG2289](https://wg21.link/cwg2289) added that the name of a structured binding must be unique in its declarative region, and was implemented in https://github.com/llvm/llvm-project/commit/bdb

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-14 Thread Yanzuo Liu via cfe-commits
@@ -3492,10 +3492,13 @@ VarDecl *BindingDecl::getHoldingVar() const { return VD; } -llvm::ArrayRef BindingDecl::getBindingPackExprs() const { +llvm::ArrayRef BindingDecl::getBindingPackDecls() const { assert(Binding && "expecting a pack expr"); - auto *RP = cast(Binding)

[clang] [clang][ExtractAPI] emit correct spelling for type aliases (PR #134007)

2025-04-04 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing \ +// RUN: --product-name=TypeAlias -triple arm64-apple-macosx -x c++-header %s -o %t/type-alias.symbols.json -verify + +// RUN: FileCheck %s --input-file %t/

[clang-tools-extra] [Clang-Tidy][NFC] Simplify check cppcoreguidelines-missing-std-forward (PR #138504)

2025-05-07 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thank you for your review! I don't have commit access. Please help me merge this PR if it's ready. https://github.com/llvm/llvm-project/pull/138504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] Fix missing initializer for inline static template member with auto caused by delayed template instantiation. (PR #138122)

2025-05-11 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: LGTM https://github.com/llvm/llvm-project/pull/138122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-11 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,296 @@ +//===--- OverridePureVirtuals.cpp *- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-11 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,296 @@ +//===--- OverridePureVirtuals.cpp *- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-11 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,296 @@ +//===--- OverridePureVirtuals.cpp *- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-11 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,296 @@ +//===--- OverridePureVirtuals.cpp *- 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: Ap

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-09 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: LGTM module nit. Are you happy with the current state? @cor3ntin @Sirraide https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-09 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Disable checking invalid template id in primary variable template initializer (PR #139490)

2025-05-11 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/139490 Workaround for #139067 >From c5a9cda3e5c3aa2b07281e373e9736045a01643b Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Mon, 12 May 2025 11:08:50 +0800 Subject: [PATCH] Disable checking invalid template id in prima

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-09 Thread Yanzuo Liu via cfe-commits
@@ -5975,9 +5975,15 @@ static bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, Definition->hasAttr( return true; - if (Info.getLangOpts().CPlusPlus11) { -const FunctionDecl *DiagDecl = Definition ? Defin

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-09 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,349 @@ +//===--- AddPureVirtualOverride.cpp --*- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,349 @@ +//===--- AddPureVirtualOverride.cpp --*- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/139348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,349 @@ +//===--- AddPureVirtualOverride.cpp --*- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,349 @@ +//===--- AddPureVirtualOverride.cpp --*- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/139348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,349 @@ +//===--- AddPureVirtualOverride.cpp --*- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,349 @@ +//===--- AddPureVirtualOverride.cpp --*- 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: Ap

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-10 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: Thank you for you work! Please add a release note in `clang-tools-extra/docs/ReleaseNotes.rst`. Please read and follow requirements/suggestions in this document such as preferring `llvm::SmallVector` and not usin

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-05-11 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: LGTM https://github.com/llvm/llvm-project/pull/130458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Handle invalid variable template specialization whose type depends on itself (#134522)" (PR #139539)

2025-05-13 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis closed https://github.com/llvm/llvm-project/pull/139539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Disable checking invalid template id in initializer of primary variable template `std::format_kind` with libstdc++ (PR #139560)

2025-05-13 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/139560 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-05-06 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/134522 >From ccab3dc1f18ffeda9acb07c0bd5f80f65cc788b9 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Sun, 6 Apr 2025 15:06:56 +0800 Subject: [PATCH 1/4] Handle invalid variable template specialization whose type depend

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-05-06 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Yes. Please help me merge this PR. Thank you for your review! https://github.com/llvm/llvm-project/pull/134522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Handle invalid variable template specialization whose type depends on itself (#134522)" (PR #139539)

2025-05-12 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/139539 #134522 triggers compilation error with libstdc++. See #139067 or . This reverts commit 91f1830cb69cab96201adba6378d64095e251f95. >From 4878337bb6b2d6152fc531

[clang] [Clang][Sema] Disable checking invalid template id in primary variable template initializer (PR #139490)

2025-05-12 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis closed https://github.com/llvm/llvm-project/pull/139490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Handle invalid variable template specialization whose type depends on itself (#134522)" (PR #139539)

2025-05-12 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis converted_to_draft https://github.com/llvm/llvm-project/pull/139539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Disable checking invalid template id in initializer of primary variable template `std::format_kind` with libstdc++ (PR #139560)

2025-05-12 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/139560 Fixes #139067 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-11 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/139348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-11 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis edited https://github.com/llvm/llvm-project/pull/139348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Disable checking invalid template id in initializer of primary variable template `std::format_kind` with libstdc++ (PR #139560)

2025-05-13 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/139560 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-ser

[clang] [Clang][Sema] Disable checking invalid template id in initializer of primary variable template `std::format_kind` with libstdc++ (PR #139560)

2025-05-14 Thread Yanzuo Liu via cfe-commits
zwuis wrote: @cor3ntin I don't have commit access. Please help me land this. By the way, should I request commit access? https://github.com/llvm/llvm-project/pull/139560 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

2025-05-17 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: %check_clang_tidy %s portability-avoid-pragma-once %t \ +// RUN: -- -- -isystem %S/Inputs/avoid-pragma-once + +#include +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: Avoid pragma once. [portability-avoid-pragma-once] zwuis wrote: You c

[clang-tools-extra] [clangd] Add tweak to add pure virtual overrides (PR #139348)

2025-05-15 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: LGTM if HighCommander4 is happy. https://github.com/llvm/llvm-project/pull/139348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix parsing of expressions of the form (T())[/*...*/] (PR #140053)

2025-05-15 Thread Yanzuo Liu via cfe-commits
@@ -710,6 +710,7 @@ Bug Fixes to C++ Support - Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107) - Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-23 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Can you handle this case `[[using gnu : deprected]]`? https://github.com/llvm/llvm-project/pull/141305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Reject array prvalue operands (PR #140702)

2025-05-20 Thread Yanzuo Liu via cfe-commits
zwuis wrote: This is related to CWG2548. CC @Endilll https://github.com/llvm/llvm-project/pull/140702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Reject array prvalue operands (PR #140702)

2025-05-21 Thread Yanzuo Liu via cfe-commits
@@ -7639,6 +7639,8 @@ def warn_param_mismatched_alignment : Warning< def err_objc_object_assignment : Error< "cannot assign to class object (%0 invalid)">; +def err_typecheck_array_prvalue_operand : Error< + "array prvalue is not permitted">; zwuis wrote:

[clang] [Clang][Sema] Reject array prvalue operands (PR #140702)

2025-05-21 Thread Yanzuo Liu via cfe-commits
@@ -7639,6 +7639,8 @@ def warn_param_mismatched_alignment : Warning< def err_objc_object_assignment : Error< "cannot assign to class object (%0 invalid)">; +def err_typecheck_array_prvalue_operand : Error< + "array prvalue is not permitted">; zwuis wrote:

<    1   2