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

2025-08-30 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/155982 >From 426caa9f66cddd1deac23b397baf75f6809f6f52 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Fri, 29 Aug 2025 15:15:24 +0800 Subject: [PATCH 1/3] Handle nested-name-specifier in "llvm-prefer-isa-or-dyn-cast-in-

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

2025-08-30 Thread Yanzuo Liu via cfe-commits
zwuis wrote: > Did you try running on LLVM code to check for any miscodegen/FP? > https://clang.llvm.org/extra/clang-tidy/#running-clang-tidy-in-parallel I just finished checking using `compile_commands.json` generated with `-DLLVM_ENABLE_PROJECTS=bolt;clang;clang-tools-extra;lld;lldb:mlir;pol

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

2025-08-30 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/155982 >From 426caa9f66cddd1deac23b397baf75f6809f6f52 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Fri, 29 Aug 2025 15:15:24 +0800 Subject: [PATCH 1/2] Handle nested-name-specifier in "llvm-prefer-isa-or-dyn-cast-in-

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

2025-08-29 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/155982 Use `declRefExpr` matcher to match callee so that we can get the `SourceRange` of the identifier of the callee for replacement. Drive-by changes: - Use `hasConditionVariableStatement` matcher to handle `if` stat

[clang] [clang][bytecode] Lazily create DynamicAllocator (PR #155831)

2025-08-28 Thread Yanzuo Liu via cfe-commits
@@ -164,7 +170,7 @@ class InterpState final : public State, public SourceMapper { /// Reference to the offset-source mapping. SourceMapper *M; /// Allocator used for dynamic allocations performed via the program. - DynamicAllocator Alloc; + std::unique_ptr Alloc; -

[clang] [clang] Update typechecking of builtin elementwise ternary math operators (PR #155620)

2025-08-27 Thread Yanzuo Liu via cfe-commits
@@ -15884,6 +15884,58 @@ static bool checkBuiltinVectorMathMixedEnums(Sema &S, Expr *LHS, Expr *RHS, return false; } +/// Check if all arguments have the same type. If the types don't match, emit an +/// error message and return true. Otherwise return false. +/// +/// For

[clang] [clang-tools-extra] [clang] Heuristic resolution for explicit object parameter (PR #155143)

2025-08-26 Thread Yanzuo Liu via cfe-commits
@@ -301,9 +302,34 @@ std::vector HeuristicResolverImpl::resolveMemberExpr( return {}; } + // check if member expr is in the context of an explicit object method + // If so, it's safe to assume the templated arg is of type of the record + const auto ExplicitMemberHeur

[clang] [clang-tools-extra] [clang] Heuristic resolution for explicit object parameter (PR #155143)

2025-08-24 Thread Yanzuo Liu via cfe-commits
@@ -301,9 +302,34 @@ std::vector HeuristicResolverImpl::resolveMemberExpr( return {}; } + // check if member expr is in the context of an explicit object method + // If so, it's safe to assume the templated arg is of type of the record + const auto ExplicitMemberHeur

[clang] [clang-tools-extra] [clang] Heuristic resolution for explicit object parameter (PR #155143)

2025-08-24 Thread Yanzuo Liu via cfe-commits
@@ -301,9 +302,34 @@ std::vector HeuristicResolverImpl::resolveMemberExpr( return {}; } + // check if member expr is in the context of an explicit object method + // If so, it's safe to assume the templated arg is of type of the record + const auto ExplicitMemberHeur

[clang] [clang-tools-extra] [clang] Heuristic resolution for explicit object parameter (PR #155143)

2025-08-24 Thread Yanzuo Liu via cfe-commits
@@ -301,9 +302,34 @@ std::vector HeuristicResolverImpl::resolveMemberExpr( return {}; } + // check if member expr is in the context of an explicit object method + // If so, it's safe to assume the templated arg is of type of the record + const auto ExplicitMemberHeur

[clang] [clang-tools-extra] [clang] Heuristic resolution for explicit object parameter (PR #155143)

2025-08-24 Thread Yanzuo Liu via cfe-commits
@@ -301,9 +302,34 @@ std::vector HeuristicResolverImpl::resolveMemberExpr( return {}; } + // check if member expr is in the context of an explicit object method + // If so, it's safe to assume the templated arg is of type of the record + const auto ExplicitMemberHeur

[clang] [clang-tools-extra] [clang] Heuristic resolution for explicit object parameter (PR #155143)

2025-08-24 Thread Yanzuo Liu via cfe-commits
@@ -301,9 +302,34 @@ std::vector HeuristicResolverImpl::resolveMemberExpr( return {}; } + // check if member expr is in the context of an explicit object method + // If so, it's safe to assume the templated arg is of type of the record + const auto ExplicitMemberHeur

[clang] [lldb] [clang] remove IsDefaulted bit from TemplateArgument (PR #155120)

2025-08-23 Thread Yanzuo Liu via cfe-commits
@@ -95,24 +95,25 @@ TC https://github.com/llvm/llvm-project/pull/155120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

2025-08-20 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/154545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][ASTMatchers] Make `hasConditionVariableStatement` support `for` loop, `while` loop and `switch` statements (PR #154298)

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

[clang] [Clang][ASTMatchers] Make `hasConditionVariableStatement` support `for` loop, `while` loop and `switch` statements (PR #154298)

2025-08-20 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thank you for your review! https://github.com/llvm/llvm-project/pull/154298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][ASTMatchers] Make `hasConditionVariableStatement` support `for` loop, `while` loop and `switch` statements (PR #154298)

2025-08-20 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/154298 >From 14102c2c5bbd5c4caa9049f87699cce82cdc4481 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Tue, 19 Aug 2025 17:29:18 +0800 Subject: [PATCH 1/2] Make `hasConditionVariableStatement` support `for` loop, `while`

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

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

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

2025-08-20 Thread Yanzuo Liu via cfe-commits
@@ -16,6 +17,16 @@ void throwError(const std::string& msg) { // expected-warning {{function 'throwE throw std::runtime_error(msg); } +// We cannot use the [[noreturn]] attribute on lambdas until C++23 +void lambda(const std::string& msg) { +#if __cplusplus >= 202302L + aut

[clang] Do not trigger -Wmissing-noreturn on lambdas prior to C++23 (PR #154545)

2025-08-20 Thread Yanzuo Liu via cfe-commits
@@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -Wmissing-noreturn -verify %s +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -Wmissing-noreturn -verify -std=c++17 %s zwuis wrote: We ca

[clang] Skip test added in #154418 to work when the default is C++20. (PR #154463)

2025-08-19 Thread Yanzuo Liu via cfe-commits
zwuis wrote: We can add `-std=c++17` and change `-verify` to `-verify=expected,cxx17` so that we can use `// cxx17-warning {{...}}` instead of adding `#if` block for some test cases. See . https://gith

[clang] [Clang][ASTMatchers] Make `hasConditionVariableStatement` support `for` loop, `while` loop and `switch` statement (PR #154298)

2025-08-19 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/154298 >From 14102c2c5bbd5c4caa9049f87699cce82cdc4481 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Tue, 19 Aug 2025 17:29:18 +0800 Subject: [PATCH 1/2] Make `hasConditionVariableStatement` support `for` loop, `while`

[clang] [Clang][ASTMatchers] Make `hasConditionVariableStatement` support `for` loop, `while` loop and `switch` statement (PR #154298)

2025-08-19 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/154298 None >From 14102c2c5bbd5c4caa9049f87699cce82cdc4481 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Tue, 19 Aug 2025 17:29:18 +0800 Subject: [PATCH] Make `hasConditionVariableStatement` support `for` loop, `whil

[clang] Fix lambda *this capture crash - Fixes #154054 (PR #154057)

2025-08-17 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Where is the fix? Only test file is modified currently. https://github.com/llvm/llvm-project/pull/154057 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix incompatible pointer to integer conversion error in array initialization - Fixes #154046 (PR #154061)

2025-08-17 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Do you know the issue is compiler crash? https://github.com/llvm/llvm-project/pull/154061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script which clears release notes (PR #153593)

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

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

2025-08-15 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Please move fix-it test to `clang/test/FixIt` folder. https://github.com/llvm/llvm-project/pull/152698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

2025-08-15 Thread Yanzuo Liu via cfe-commits
@@ -4401,6 +4401,11 @@ def warn_impcast_different_enum_types : Warning< def warn_impcast_int_to_enum : Warning< "implicit conversion from %0 to enumeration type %1 is invalid in C++">, InGroup, DefaultIgnore; + +def note_no_implicit_conversion_for_scoped_enum +: Note<"n

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script which clears release notes (PR #153593)

2025-08-15 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thank you for your review! > @zwuis do you need someone to merge the PR for you? I can merge the PR by myself :) https://github.com/llvm/llvm-project/pull/153593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script which clears release notes (PR #153593)

2025-08-15 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/153593 >From 1fdf80aac85fdade340ac8ae17519a0b4d68d0f7 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Thu, 14 Aug 2025 23:01:41 +0800 Subject: [PATCH 1/4] Add script to clear release notes --- clang-tools-extra/docs/Re

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script which clears release notes (PR #153593)

2025-08-14 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/153593 >From 1fdf80aac85fdade340ac8ae17519a0b4d68d0f7 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Thu, 14 Aug 2025 23:01:41 +0800 Subject: [PATCH 1/3] Add script to clear release notes --- clang-tools-extra/docs/Re

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script which clears release notes (PR #153593)

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

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script to clear release notes (PR #153593)

2025-08-14 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/153593 >From 1fdf80aac85fdade340ac8ae17519a0b4d68d0f7 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Thu, 14 Aug 2025 23:01:41 +0800 Subject: [PATCH 1/2] Add script to clear release notes --- clang-tools-extra/docs/Re

[clang] [clang-tools-extra] [flang] [lld] [llvm] [LLVM][utils] Add script to clear release notes (PR #153593)

2025-08-14 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/153593 The script copies `ReleaseNotesTemplate.txt` to corresponding `ReleaseNotes.rst`/`.md` to clear release notes. The suffix of `ReleaseNotesTemplate.txt` must be `.txt`. If it is `.rst`/`.md`, it will be treated a

[clang-tools-extra] [clangd] extend and rearrange doxygen hover documentation (PR #152918)

2025-08-10 Thread Yanzuo Liu via cfe-commits
@@ -263,8 +264,76 @@ class BlockCommentToMarkupDocument StringRef CommentEscapeMarker; }; -void SymbolDocCommentVisitor::parameterDocToMarkup(StringRef ParamName, - markup::Paragraph &Out) { +void SymbolDocCommentVisitor::vis

[clang-tools-extra] [clangd] extend and rearrange doxygen hover documentation (PR #152918)

2025-08-10 Thread Yanzuo Liu via cfe-commits
@@ -135,7 +135,11 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) { std::string RawDoc; llvm::raw_string_ostream OS(RawDoc); -V.parameterDocToString(dyn_cast(&Decl)->getName(), OS); +if (isa(Decl)) + V.parameterDocToString(dyn_

[clang-tools-extra] [clangd] extend and rearrange doxygen hover documentation (PR #152918)

2025-08-10 Thread Yanzuo Liu via cfe-commits
@@ -112,7 +112,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) { std::string Doc; if (Cfg.Documentation.CommentFormat == Config::CommentFormatPolicy::Doxygen && - isa(Decl)) { + (isa(Decl) || isa(Decl))) { zwuis wr

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

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

[clang] [Clang] Add detailed notes explaining why is_aggregate evaluates to false (PR #152488)

2025-08-09 Thread Yanzuo Liu via cfe-commits
@@ -2595,6 +2596,105 @@ static void DiagnoseNonStandardLayoutReason(Sema &SemaRef, SourceLocation Loc, SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D; } +static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc, +

[clang] Fix MSVC warning in CompilerInvocation.cpp (PR #152809)

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

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

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

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

2025-08-08 Thread Yanzuo Liu via cfe-commits
@@ -10772,9 +10811,14 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS, if (LHS.isInvalid() || RHS.isInvalid()) return QualType(); - - if (compType.isNull() || !compType->isArithmeticType()) -return InvalidOperands(Loc, LHS, RHS); + i

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

2025-08-08 Thread Yanzuo Liu via cfe-commits
@@ -4401,6 +4401,11 @@ def warn_impcast_different_enum_types : Warning< def warn_impcast_int_to_enum : Warning< "implicit conversion from %0 to enumeration type %1 is invalid in C++">, InGroup, DefaultIgnore; + +def note_no_implicit_conversion_for_scoped_enum +: Note<"n

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

2025-08-08 Thread Yanzuo Liu via cfe-commits
@@ -1,5 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify -triple x86_64-apple-darwin %s // RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++17 -verify -triple x86_64-apple-darwin %s zwuis wrote: We can change `-verify` to `-verify=expected

[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)

2025-08-08 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: Thank you for your patch! Please add fix-it test. And please add a release note entry to `clang/docs/ReleaseNotes.rst` so that users can know the improvement. https://github.com/llvm/llvm-project/pull/152698 ___ cfe

[clang] [Clang][NFC] Enumerate Clang ABI versions in a separate header file (PR #151995)

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

[clang] [Clang][NFC] Enumerate Clang ABI versions in a separate header file (PR #151995)

2025-08-07 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thank you for your review! https://github.com/llvm/llvm-project/pull/151995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Enumerate Clang abi versions in a separate header file (PR #151995)

2025-08-04 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/151995 Make it easier for us to add abi versions. Close #144332 >From 8881838e71226a31f06333ef55a73718f32b Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Tue, 5 Aug 2025 00:19:53 +0800 Subject: [PATCH] Enumerate C

[clang] Fix crash when doing special member lookup on forward-declared classes (Fixes llvm/llvm-project#144642) (PR #144828)

2025-08-04 Thread Yanzuo Liu via cfe-commits
zwuis wrote: > Hi! I want to close this PR. What do I need to do? You can just close this PR. https://github.com/llvm/llvm-project/pull/144828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [clang][bytecode] Use SmallVector for Function::Code (PR #151821)

2025-08-02 Thread Yanzuo Liu via cfe-commits
@@ -135,7 +135,7 @@ int32_t ByteCodeEmitter::getOffset(LabelTy Label) { /// Helper to write bytecode and bail out if 32-bit offsets become invalid. /// Pointers will be automatically marshalled as 32-bit IDs. template -static void emit(Program &P, std::vector &Code, const T &V

[clang] [clang][diagnostics] Fix fix-it hint parenthesis placement for fold expressions (PR #151790)

2025-08-02 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: LGTM but please let other people take a look. https://github.com/llvm/llvm-project/pull/151790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][diagnostics] Fix fix-it hint parenthesis placement for fold expressions (PR #151790)

2025-08-01 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -verify -std=c++17 -pedantic-errors %s +// RUN: cp %s %t +// RUN: not %clang_cc1 -x c++ -std=c++17 -fixit %t +// RUN: %clang_cc1 -Wall -pedantic-errors -x c++ -std=c++17 %t + +/* This is a test of the various code modification hints that only +

[clang] [Clang][Sema] Expression in assumption attribute should be full expression (PR #150814)

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

[clang] [Clang][Sema] Expression in assumption attribute should be full expression (PR #150814)

2025-07-28 Thread Yanzuo Liu via cfe-commits
zwuis wrote: > Is there no issue associated with the crash? I ran into this assertion failure when trying to implement cwg712. I tried to search issues but found nothing. https://github.com/llvm/llvm-project/pull/150814 ___ cfe-commits mailing list c

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2025-07-27 Thread Yanzuo Liu via cfe-commits
zwuis wrote: > Then what is the benefits? Adding `__builtin_lambda_this()` is prerequisite of fixing the issue which this PR tries to fix, because we cannot access the caller of lambda `operator()` without adding compiler magic such as builtin functions. > Whatever it is, I feel this can/shou

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2025-07-27 Thread Yanzuo Liu via cfe-commits
zwuis wrote: > Would you like to give a brief introduction for your design. I didn't figure > it out. - The function signature of `__builtin_lambda_this()` is `void*()`. - Sema part: if it is a non-staic lambda expression (similar with this PR), create an expression `static_cast(__builtin_lamb

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2025-07-27 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Hi. I tried to fix this issue locally by adding a function `__builtin_lambda_this()` and it seems to work. I can create PR if you think this is a good approach. And I have some questions: 1. Should this builtin function handle lambda expression only? What about `__builtin_member_

[clang] [Clang][Sema] Expression in assumption attribute should be full expression (PR #150814)

2025-07-26 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/150814 Add missing `ActOnFinishFullExpr` to `BuildCXXAssumeExpr`. We did it during template instantiation but forgot non-template case. >From 28d6be07b613662c5a0d9491c67cf880eb42eadc Mon Sep 17 00:00:00 2001 From: Yanzu

[clang] [PATCH 1/7] [clang] Improve nested name specifier AST representation (PR #147835)

2025-07-22 Thread Yanzuo Liu via cfe-commits
zwuis wrote: I added comment `// FIXME (GH147000): duplicate diagnostics` to `clang/test/SemaCXX/nested-name-spec.cpp` in #147003. Please remove the comment if that issue is fixed by this patch. https://github.com/llvm/llvm-project/pull/147835 ___ cf

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-22 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Can you manually backport this patch? See #150131. https://github.com/llvm/llvm-project/pull/149227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid inheriting [[noreturn]] in explicit function template specializations (PR #150003)

2025-07-22 Thread Yanzuo Liu via cfe-commits
zwuis wrote: I think we need to test partial specialization as well. https://github.com/llvm/llvm-project/pull/150003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid inheriting [[noreturn]] in explicit function template specializations (PR #150003)

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

[clang] [NFC][clang] Avoid inheriting [[noreturn]] in explicit function template specializations (PR #150003)

2025-07-22 Thread Yanzuo Liu via cfe-commits
@@ -44,3 +44,18 @@ void testTemplates() { throwErrorTemplate("ERROR"); (void)ensureZeroTemplate(42); } + +// Ensure that explicit specialization of a member function does not inherit +// the warning from the primary template. + +template +struct S { + void f(); +}; + +temp

[clang] [NFC][clang] Avoid inheriting [[noreturn]] in explicit function template specializations (PR #150003)

2025-07-22 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Can you add this test case? ```cpp template struct S { void f(); }; template void S::f() {} template<> void S::f() { throw 0; } ``` https://github.com/llvm/llvm-project/pull/150003 ___

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-22 Thread Yanzuo Liu via cfe-commits
@@ -547,6 +547,15 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, return; } case AR_Deprecated: +// Suppress -Wdeprecated-declarations in purely implicit special-member functions. +if (auto *MD = dyn_cast_if_present(S.getCurFunctionDecl

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-22 Thread Yanzuo Liu via cfe-commits
@@ -547,6 +547,15 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, return; } case AR_Deprecated: +// Suppress -Wdeprecated-declarations in purely implicit special-member functions. +if (auto *MD = dyn_cast_if_present(S.getCurFunctionDecl

[clang] [PATCH 1/6] [clang] Improve nested name specifier AST representation (PR #147835)

2025-07-21 Thread Yanzuo Liu via cfe-commits
@@ -181,14 +181,14 @@ template class DynamicRecursiveASTVisitorBase { /// /// \returns false if the visitation was terminated early, true /// otherwise (including when the argument is a Null type). - virtual bool TraverseType(QualType T); + virtual bool TraverseType(Q

[clang] [clang-tools-extra] [Clang][AST][NFC] Introduce `NamespaceBaseDecl` (PR #149123)

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

[clang] [clang][bytecode] Fix contains check using llvm::find (PR #149050)

2025-07-16 Thread Yanzuo Liu via cfe-commits
@@ -575,7 +575,8 @@ bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { // The This pointer is writable in constructors and destructors, // even if isConst() returns true. - if (llvm::find(S.InitializingBlocks, Ptr.block())) + if (llvm::find(S.Initializi

[clang] [clang] Update diagnostics and documentation for type aware allocators (PR #148576)

2025-07-14 Thread Yanzuo Liu via cfe-commits
@@ -0,0 +1,155 @@ += +C++ Type Aware Allocators += + +.. contents:: + :local: + +Introduction + + +Clang includes an implementation of P2719 "Type-aware allocation and deallocation +functions". + +This is a feature tha

[clang] [clang] Update diagnostics and documentation for type aware allocators (PR #148576)

2025-07-14 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/148576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Update diagnostics and documentation for type aware allocators (PR #148576)

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

[clang] [clang] Update diagnostics for type aware allocators (PR #148576)

2025-07-14 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Please update `clang/docs/LanguageExtensions.rst`. https://github.com/llvm/llvm-project/pull/148576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)

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

[clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)

2025-07-12 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thanks for your review. https://github.com/llvm/llvm-project/pull/148195 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)

2025-07-11 Thread Yanzuo Liu via cfe-commits
zwuis wrote: > > I'm not sure if I should update > > `llvm/include/llvm/Testing/Demangle/DemangleTestCases.inc` and > > `libcxxabi/test/DemangleTestCases.inc`. > > Why would you need to? There are no changes to mangling/demangling here AFAICT These files test demangling `RecordDecl::isInjecte

[clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)

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

[clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)

2025-07-11 Thread Yanzuo Liu via cfe-commits
zwuis wrote: I'm not sure if I should update `llvm/include/llvm/Testing/Demangle/DemangleTestCases.inc` and `libcxxabi/test/DemangleTestCases.inc`. https://github.com/llvm/llvm-project/pull/148195 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [clang-tools-extra] [lldb] [Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName` (PR #148195)

2025-07-11 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/148195 Co-authored-by: Matheus Izvekov >From 306049aa7dd17f6683935d631b3ad222b268a3f2 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Fri, 11 Jul 2025 18:17:05 +0800 Subject: [PATCH] (`RecordDecl` -> `CXXRecordDecl`)`:

[clang-tools-extra] [clangd] Add tweak to override pure virtuals (PR #139348)

2025-07-08 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Do you need the help to merge this PR? 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] Sema: suppress deprecated field warnings in implicit special-member functions Fixes: https://github.com/llvm/llvm-project/issues/147293 (PR #147400)

2025-07-08 Thread Yanzuo Liu via cfe-commits
@@ -547,6 +547,20 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, return; } case AR_Deprecated: +// Suppress -Wdeprecated-declarations in purely implicit special-member functions. +if (const FunctionDecl *FD = S.getCurFunctionDecl()) {

[clang] Sema: suppress deprecated field warnings in implicit special-member functions Fixes: https://github.com/llvm/llvm-project/issues/147293 (PR #147400)

2025-07-08 Thread Yanzuo Liu via cfe-commits
@@ -547,6 +547,20 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, return; } case AR_Deprecated: +// Suppress -Wdeprecated-declarations in purely implicit special-member functions. +if (const FunctionDecl *FD = S.getCurFunctionDecl()) {

[clang] [Clang][Sema] Do not perform error recovery for invalid member using-declaration in C++20+ mode (PR #147003)

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

[clang] [Clang][Sema] Do not perform error recovery for invalid member using-declaration in C++20+ mode (PR #147003)

2025-07-04 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/147003 >From 32e2c12d44da29e20212bdeed3628d4c736191ad Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Fri, 4 Jul 2025 13:58:17 +0800 Subject: [PATCH] Do not perform error recovery for invalid member using-declaration in

[clang] [clang][diagnostics] Refactor "warn_doc_api_container_decl_mismatch" to use enum_select (PR #146433)

2025-07-04 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Can we merge this with private email address? https://github.com/llvm/llvm-project/pull/146433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Do not perform error recovery for invalid member using-declaration in C++20+ mode (PR #147003)

2025-07-03 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis created https://github.com/llvm/llvm-project/pull/147003 Previously, Clang tried to perform error recovery for invalid member using-declaration whose nested-name-specifier refers to its own class in C++20+ mode, which causes crash. ```cpp template struct V {}; struct

[clang] [clang-tools-extra] [clang][CodeComplete] skip explicit obj param in SignatureHelp (PR #146649)

2025-07-02 Thread Yanzuo Liu via cfe-commits
@@ -6,9 +6,21 @@ int main() { A a {}; a. } -// RUN: %clang_cc1 -cc1 -fsyntax-only -code-completion-at=%s:%(line-2):5 -std=c++23 %s | FileCheck %s -// CHECK: COMPLETION: A : A:: -// CHECK-NEXT: COMPLETION: foo : [#void#]foo(<#int arg#>) -// CHECK-NEXT: COMPLETION: operator=

[clang] [clang-tools-extra] [clang][CodeComplete] skip explicit obj param in SignatureHelp (PR #146649)

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

[clang] [clang-tools-extra] [clang][CodeComplete] skip explicit obj param in SignatureHelp (PR #146649)

2025-07-02 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis commented: Thank you for the fix! https://github.com/llvm/llvm-project/pull/146649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Bytecode] Implement P1061 structured binding pack (PR #146474)

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

[clang] [Clang][Bytecode] Implement P1061 structured binding pack (PR #146474)

2025-07-01 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thank you for your review. https://github.com/llvm/llvm-project/pull/146474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Bytecode] Implement P1061 structured binding pack (PR #146474)

2025-07-01 Thread Yanzuo Liu via cfe-commits
@@ -17,7 +18,7 @@ struct fake_tuple { int arr[4] = {1, 2, 3, 6}; template - int get() { + constexpr int& get() { zwuis wrote: > Were these two functions never called in a constant context before? Yes. Only semantic analysis was performed on these func

[clang] [libcxx] [clang] [modules] Implement P3618R0: Allow attaching main to the global module (PR #146461)

2025-07-01 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Please update "clang/www/cxx_status.html". https://github.com/llvm/llvm-project/pull/146461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Require `BaseClass::` (not other classes) in member using-declaration in C++98 mode (PR #143492)

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

[clang] [Clang][Sema] Require `BaseClass::` (not other classes) in member using-declaration in C++98 mode (PR #143492)

2025-06-30 Thread Yanzuo Liu via cfe-commits
zwuis wrote: Thank you for your review! Failed test in CI is not related. https://github.com/llvm/llvm-project/pull/143492 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Require `BaseClass::` (not other classes) in member using-declaration in C++98 mode (PR #143492)

2025-06-30 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/143492 >From 658f3d3cb72ff9fbdb2315f894f39956eeabf135 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Tue, 10 Jun 2025 16:41:57 +0800 Subject: [PATCH 1/5] Apply CWG400 'Using-declarations and the "struct hack"' to C++98

[clang] [Clang][Sema] Require `BaseClass::` (not other classes) in member using-declaration in C++98 mode (PR #143492)

2025-06-29 Thread Yanzuo Liu via cfe-commits
https://github.com/zwuis updated https://github.com/llvm/llvm-project/pull/143492 >From 658f3d3cb72ff9fbdb2315f894f39956eeabf135 Mon Sep 17 00:00:00 2001 From: Yanzuo Liu Date: Tue, 10 Jun 2025 16:41:57 +0800 Subject: [PATCH 1/4] Apply CWG400 'Using-declarations and the "struct hack"' to C++98

[clang] [clang-tools-extra] [clang] skip explicit obj param in code complete (PR #146258)

2025-06-29 Thread Yanzuo Liu via cfe-commits
zwuis wrote: What about "ExplicitObjectMemberFunction"? It seems that this part of feature has not been tested. https://github.com/llvm/llvm-project/pull/146258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [NFC][docs][coro] Fix syntax & typos (PR #146282)

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

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-28 Thread Yanzuo Liu via cfe-commits
@@ -301,177 +735,284 @@ optimized to the equivalent of: std::cout << a+5 << "\n"; } -It should now be obvious why the value of `__int_32_0` remains unchanged -throughout the function. It is important to recognize that `__int_32_0` -does not directly correspond to `a`, bu

  1   2   3   >