[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-06 Thread Younan Zhang via cfe-commits
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 zyn0217 wrote: Thanks for the post cleanup! Just learned how t

[clang] Fix extra parenthesis in diagnostic (PR #122055)

2025-01-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Good catch, thanks! https://github.com/llvm/llvm-project/pull/122055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-08 Thread Younan Zhang via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, NonTypeTemplateParmDecl *NewConstrainedParm,

[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

2025-01-07 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (I plan to merge this after the branch 20 cut to avoid any potential revert churn. So it will stay in draft for now) https://github.com/llvm/llvm-project/pull/121044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [Clang] Don't form a type constraint if the concept is invalid (PR #122065)

2025-01-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/122065 After 0dedd6fe1 and 03229e7c0, invalid concept declarations might lack expressions for evaluation and normalization. This could make it crash in certain scenarios, apart from the one of evaluation concepts show

[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

2024-12-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/121296 Otherwise, the invalid unexpanded type would be passed to getAutoType and lead to a crash. Fixes https://github.com/llvm/llvm-project/issues/88866 >From 102e031cae56c130f48f08bcb316b6f451facf49 Mon Sep 17 00:0

[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

2024-12-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/121296 >From 102e031cae56c130f48f08bcb316b6f451facf49 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 29 Dec 2024 23:13:52 +0800 Subject: [PATCH] [Clang] Diagnose unexpanded packs for NTTP type constraints ---

[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

2024-12-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/121296 >From 102e031cae56c130f48f08bcb316b6f451facf49 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 29 Dec 2024 23:13:52 +0800 Subject: [PATCH 1/2] [Clang] Diagnose unexpanded packs for NTTP type constraints

[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

2024-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/121044 ... and "[Clang] fix missing initialization of original number of expansions" This reverts commit acecf68c8b7c3c625cfa00f00f8ddc8f15baae44. >From aa008450981a80a2d26e687df33f10038aa50a9c Mon Sep 17 00:00:00 200

[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

2024-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/121044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add a unit test suite for HeuristicResolver (PR #121313)

2024-12-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. LGTM, feel free to merge unless you prefer additional input from other maintainers. https://github.com/llvm/llvm-project/pull/121313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

2024-12-30 Thread Younan Zhang via cfe-commits
@@ -305,3 +305,45 @@ static_assert(__is_same_as(_Three_way_comparison_result_with_tuple_like, 0>::type, long)); } + +namespace GH88866 { + +template struct index_by; + +template +concept InitFunc = true; + +namespace Invalid { + +template auto... init> +struct LazyLitMatri

[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

2024-12-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/121296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)

2024-12-27 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -fsyntax-only %s -verify +// expected-no-diagnostics + +template +int g() { + return [] (auto) -> int { +struct L { + int m = i; +}; +return 0; + } (42); zyn0217 wrote: I feel like this is some fallout of n

[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)

2024-12-28 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -fsyntax-only %s -verify +// expected-no-diagnostics + +template +int g() { + return [] (auto) -> int { +struct L { + int m = i; +}; +return 0; + } (42); zyn0217 wrote: Yeah, probably also worth an assertio

[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

2024-12-31 Thread Younan Zhang via cfe-commits
@@ -857,7 +857,8 @@ class PackDeductionScope { if (auto *NTTP = dyn_cast( TemplateParams->getParam(Index))) { if (!NTTP->isExpandedParameterPack()) - if (auto *Expansion = dyn_cast(NTTP->getType())) + if (auto *Expansion = dyn_cast(

[clang] [clang] [ASTDump] Add support for structural value template arguments in TextNodeDumper (PR #126341)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for the patch. This needs a test and a release note. https://github.com/llvm/llvm-project/pull/126341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-07 Thread Younan Zhang via cfe-commits
@@ -1654,11 +1654,20 @@ void Sema::EmitDiagnostic(unsigned DiagID, const DiagnosticBuilder &DB) { } case DiagnosticIDs::SFINAE_Suppress: + if (DiagnosticsEngine::Level Level = getDiagnostics().getDiagnosticLevel( + DiagInfo.getID(), DiagInfo.getLocat

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-07 Thread Younan Zhang via cfe-commits
@@ -1909,7 +1909,19 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = zyn02

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-07 Thread Younan Zhang via cfe-commits
@@ -1909,7 +1909,22 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = + llvm::function_

[clang] [Clang][Sema] Fix wrong initialization kind when handling initializing structured bindings from an array with direct-list-initialization (PR #124793)

2025-02-07 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @zwuis Can you resolve the conflicts before we help you merge it? thanks https://github.com/llvm/llvm-project/pull/124793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [ASTDump] Add support for structural value template arguments in TextNodeDumper (PR #126341)

2025-02-07 Thread Younan Zhang via cfe-commits
@@ -54,6 +54,8 @@ ABI Changes in This Version AST Dumping Potentially Breaking Changes +- Added support for dumping structural value template arguments in AST dumps. (#GH126341) zyn0217 wrote: We don't usually referen

[clang] [clang] [ASTDump] Add support for structural value template arguments in TextNodeDumper (PR #126341)

2025-02-07 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -std=c++20 -ast-dump -ast-dump-filter=pr126341 %s | FileCheck %s zyn0217 wrote: Can you consolidate the test into a pre-existing file e.g. `AST/ast-dump-templates.cpp`? https://github.com/llvm/llvm-project/pull/126341 _

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/126206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > I see the test references https://github.com/llvm/llvm-project/issues/124715 > but you don't mention it in the summary and you don't have a release note. > Does the test exercise the crash? Oh, thanks for spotting that - I forgot it when I updated the commit body. Will add a

[clang] [Clang][Sema] Fix wrong initialization kind when handling initializing structured bindings from an array with direct-list-initialization (PR #124793)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/124793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Form PackExpansionTypes of TemplateArguments for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/126206 When substituting for rewrite purposes, as in rebuilding constraints for a synthesized deduction guide, it assumed that packs were in `PackExpansion*` form, such that the instantiator could extract a pattern. F

[clang] [Clang] Form PackExpansionTypes of TemplateArguments for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 converted_to_draft https://github.com/llvm/llvm-project/pull/126206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/126206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/126206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/126206 >From 2ce86d8842b7b37141d4a415830880b9d1d30260 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 7 Feb 2025 17:15:05 +0800 Subject: [PATCH] [Clang] Remove the PackExpansion restrictions for rewrite substit

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/126206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-06 Thread Younan Zhang via cfe-commits
@@ -1197,25 +1197,19 @@ Decl *TemplateDeclInstantiator::VisitDecompositionDecl(DecompositionDecl *D) { for (auto *NewBD : NewBindings) NewBD->setInvalidDecl(); - if (OldResolvedPack) { -// Mark the holding vars (if any) in the pack as instantiated since -//

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

2025-02-06 Thread Younan Zhang via cfe-commits
@@ -1178,13 +1178,13 @@ Decl *TemplateDeclInstantiator::VisitDecompositionDecl(DecompositionDecl *D) { // Transform the bindings first. // The transformed DD will have all of the concrete BindingDecls. SmallVector NewBindings; - ResolvedUnexpandedPackExpr *OldResolvedPa

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

2025-02-06 Thread Younan Zhang 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][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-06 Thread Younan Zhang via cfe-commits
@@ -4649,49 +4649,48 @@ class SubstNonTypeTemplateParmPackExpr : public Expr { /// \endcode class FunctionParmPackExpr final : public Expr, - private llvm::TrailingObjects { + private llvm::TrailingObjects { zyn0217 wrote: Can we also update the

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

2025-02-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks, a few more comments https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-06 Thread Younan Zhang via cfe-commits
@@ -980,24 +980,24 @@ static bool CheckBindingsCount(Sema &S, DecompositionDecl *DD, if (IsValid && HasPack) { // Create the pack expr and assign it to the binding. unsigned PackSize = MemberCount - Bindings.size() + 1; -QualType PackType = S.Context.getPackExpan

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

2025-02-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-10 Thread Younan Zhang via cfe-commits
@@ -6749,6 +6749,21 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { CodeCompleteExpression(S, Data); } +void SemaCodeCompletion::CodeCompleteIfConstExpr(Scope *S) const { + ResultBuilder Results(SemaRef, CodeCompleter->getAllocator(), +

[clang] [clang][HeuristicResolver] Track the expression whose type is being simplified after each step in simplifyType() (PR #126689)

2025-02-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks for the prompt fix. The explanation makes sense to me, however please wait for @kadircet to confirm this fixes their problems. https://github.com/llvm/llvm-project/pull/126689 ___ cfe-commi

[clang] [clang][HeuristicResolver] Track the expression whose type is being simplified after each step in simplifyType() (PR #126689)

2025-02-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/126689 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-10 Thread Younan Zhang via cfe-commits
@@ -6749,6 +6749,21 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { CodeCompleteExpression(S, Data); } +void SemaCodeCompletion::CodeCompleteIfConstExpr(Scope *S) const { + ResultBuilder Results(SemaRef, CodeCompleter->getAllocator(), +

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-10 Thread Younan Zhang via cfe-commits
@@ -152,6 +152,7 @@ class SemaCodeCompletion : public SemaBase { void CodeCompleteDesignator(const QualType BaseType, llvm::ArrayRef InitExprs, const Designation &D); + void CodeCompleteIfConstExpr(Scope *S) const;

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-10 Thread Younan Zhang via cfe-commits
@@ -6749,6 +6749,21 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { CodeCompleteExpression(S, Data); } +void SemaCodeCompletion::CodeCompleteIfConstExpr(Scope *S) const { + ResultBuilder Results(SemaRef, CodeCompleter->getAllocator(), +

[clang] [clang] CTAD: Remove an incorrect assertion in BuildDeductionGuideForTypeAlias (PR #126532)

2025-02-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/126532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-02-12 Thread Younan Zhang via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -786,12 +786,16 @@ NonType

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-02-12 Thread Younan Zhang via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID:

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-02-12 Thread Younan Zhang via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: https://github.com/zyn0217 edited https://git

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2025-02-12 Thread Younan Zhang via cfe-commits
@@ -3636,18 +3644,23 @@ ExprResult Parser::ParseRequiresExpression() { // Start of requirement list llvm::SmallVector Requirements; - // C++2a [expr.prim.req]p2 - // Expressions appearing within a requirement-body are unevaluated operands. - EnterExpressionEvaluation

[clang] [clang][HeuristicResolver] Only perform qualifier check for instance methods (PR #125166)

2025-01-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Oops... https://github.com/llvm/llvm-project/pull/125166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Fix wrong call location of `DefaultArgExpr`. (PR #119212)

2024-12-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/119212 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Don't check incomplete CXXRecordDecl's members when transforming sizeof...(expr) (PR #119344)

2024-12-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/119344 For a FunctionParmPackExpr that is used as the argument of a sizeof...(pack) expression, we might exercise the logic that checks the CXXRecordDecl's members regardless of the type being incomplete, when rebuild

[clang] [Clang] Don't check incomplete CXXRecordDecl's members when transforming sizeof...(expr) (PR #119344)

2024-12-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/119344 >From bca3cea00ce3e3980a45433d831cae86dec4b7e6 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 10 Dec 2024 16:56:15 +0800 Subject: [PATCH 1/2] [Clang] Don't check incomplete CXXRecordDecl's members when

[clang] [Clang][Parser] Add a warning to ambiguous uses of T...[N] types (PR #116332)

2024-12-12 Thread Younan Zhang via cfe-commits
@@ -253,6 +254,19 @@ bool Parser::ParseOptionalCXXScopeSpecifier( if (Type.isNull()) return false; +// C++ [cpp23.dcl.dcl-2]: +// Previously, T...[n] would declare a pack of function parameters. +// T...[n] is now a pack-index-specifier. [...] Valid C

[clang] [Clang][Parser] Add a warning to ambiguous uses of T...[N] types (PR #116332)

2024-12-12 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Friendly ping https://github.com/llvm/llvm-project/pull/116332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Parser] Add a warning to ambiguous uses of T...[N] types (PR #116332)

2024-12-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/116332 >From 5973de1d4c368a26fd179954a13de94595f35575 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 15 Nov 2024 14:09:14 +0800 Subject: [PATCH 1/5] [Clang][Parser] Make 'T...[N]' within a function parameter a

[clang] [Clang] Don't assume unexpanded PackExpansions' size when expanding packs (PR #120380)

2024-12-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/120380 Fixes #61415 Fixes #32252 Fixes #17042 >From 3dd62b0dc3d913b76072c4dc0a7c0d172fe9d529 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 18 Dec 2024 16:22:15 +0800 Subject: [PATCH] [Clang] Don't assume unex

[clang] [Clang] Don't assume unexpanded PackExpansions' size when expanding packs (PR #120380)

2024-12-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/120380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Don't assume unexpanded PackExpansions' size when expanding packs (PR #120380)

2024-12-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/120380 >From 3dd62b0dc3d913b76072c4dc0a7c0d172fe9d529 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 18 Dec 2024 16:22:15 +0800 Subject: [PATCH 1/2] [Clang] Don't assume unexpanded PackExpansions' size when ex

[clang] [Clang] Don't assume unexpanded PackExpansions' size when expanding packs (PR #120380)

2024-12-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/120380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Parser] Add a warning to ambiguous uses of T...[N] types (PR #116332)

2024-12-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/116332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Don't assume unexpanded PackExpansions' size when expanding packs (PR #120380)

2024-12-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/120380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-11-17 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin Not much, we just need to move the handling of the friend declaration outside of `getTemplateInstantiationArgs()` :) Do you see any other outstanding issues? If not, can we go ahead with the status quo so we have sufficient timeframe in clang 20 cycle in case something

[clang] [Clang] Don't add top-level const qualifiers to captured function types (PR #118050)

2024-12-03 Thread Younan Zhang via cfe-commits
@@ -18789,7 +18792,11 @@ static bool captureInLambda(LambdaScopeInfo *LSI, ValueDecl *Var, // parameter-declaration-clause is not followed by mutable. DeclRefType = CaptureType.getNonReferenceType(); bool Const = LSI->lambdaCaptureShouldBeConst(); -if (Const

[clang] [Clang] Fix typo in ItaniumRecordLayoutBuilder API (PR #118563)

2024-12-03 Thread Younan Zhang via cfe-commits
@@ -818,7 +818,7 @@ class ItaniumRecordLayoutBuilder { void setSize(CharUnits NewSize) { Size = Context.toBits(NewSize); } void setSize(uint64_t NewSize) { Size = NewSize; } - CharUnits getAligment() const { return Alignment; } + CharUnits getAlignment() const { return A

[clang] [Clang] Don't add top-level const qualifiers to captured function types (PR #118050)

2024-12-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/118050 >From 92b8a28eb7664b3cac6a8039834b099b010af3ed Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 29 Nov 2024 13:19:30 +0800 Subject: [PATCH 1/2] [Clang] Don't add top-level const qualifiers to captured fun

[clang] [Sema] Migrate away from PointerUnion::{is, get} (NFC) (PR #120829)

2024-12-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. https://github.com/llvm/llvm-project/pull/120829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 converted_to_draft https://github.com/llvm/llvm-project/pull/122423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/5] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/6] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/122423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/122423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Fix a test failure with mold linker (PR #122587)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/122587 Mold prefers the suffix '$' for symbols like PLT and GOT entries, so exclude these symbols as well. Otherwise, this test will fail for developers using mold-linked Clang. >From 19467fe0e48abfe85003ebf80e29a37

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/4] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/2] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang][NFC] Fix a test failure with mold linker (PR #122587)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/122587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/3] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/122423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @mysterymath @zmodem Can you both test this patch on Windows to confirm if it resolves issues you've reported? We'd greatly appreciate it! https://github.com/llvm/llvm-project/pull/122423 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [Clang] Don't form a type constraint if the concept is invalid (PR #122065)

2025-01-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122065 >From 312776183068b84ddfea38ea7158c44c1926160a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 8 Jan 2025 15:40:23 +0800 Subject: [PATCH 1/2] [Clang] Don't form a type constraint if the concept is invali

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Is kinda wrong, it should be in the instantiation of that function... @erichkeane I don’t quite understand: the CWG issue itself requires us to check the constraint before substituting into the function during template argument deduction. So it shouldn’t live in a specializati

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin Do we need to revert it for now? https://github.com/llvm/llvm-project/pull/102857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I see the problem here: When substituting into the constraint __is_derived_from_optional with [_Tp = __sfinae_assign_base] prior to substituting the three-way operator, we must also substitute into the lambda call expression. This requires instantiating the lambda body to deduc

[clang] Revert "[Clang] Implement CWG2369 "Ordering between constraints and substitution"" (PR #122130)

2025-01-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/122130 Unfortunately that breaks some code on Windows when lambdas come into play, as reported in https://github.com/llvm/llvm-project/pull/102857#issuecomment-2577861178 This reverts commit 96eced624e0f120155256033f

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Reverted in https://github.com/llvm/llvm-project/pull/122130 https://github.com/llvm/llvm-project/pull/102857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/3] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 converted_to_draft https://github.com/llvm/llvm-project/pull/122423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/5] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/5] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang][NFC] Fix a test failure with mold linker (PR #122587)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/122587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Fix a test failure with mold linker (PR #122587)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/122587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

2025-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/122423 >From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 Jan 2025 09:46:24 +0800 Subject: [PATCH 1/7] Reapply "[Clang] Implement CWG2369 "Ordering between constra

[clang] [Clang] Delegate part of SetupConstraintScope's job to LambdaScopeForCallOperatorInstantiationRAII (PR #123687)

2025-01-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/123687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG 2628 "Implicit deduction guides should propagate constraints" (PR #111143)

2025-01-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/43 >From 567177e658ede96a59a22af14c9472e232391487 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 4 Oct 2024 20:22:59 +0800 Subject: [PATCH 1/2] [Clang] Implement CWG 2628 "Implicit deduction guides should

[clang] [Clang] Implement CWG 2628 "Implicit deduction guides should propagate constraints" (PR #111143)

2025-01-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/43 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG 2628 "Implicit deduction guides should propagate constraints" (PR #111143)

2025-01-22 Thread Younan Zhang via cfe-commits
@@ -445,10 +449,46 @@ struct ConvertConstructorToDeductionGuideTransform { return nullptr; TypeSourceInfo *NewTInfo = TLB.getTypeSourceInfo(SemaRef.Context, NewType); +// At this point, the function parameters are already 'instantiated' in the zy

[clang] [Clang] Delegate part of SetupConstraintScope's job to LambdaScopeForCallOperatorInstantiationRAII (PR #123687)

2025-01-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/123687 Now that the RAII object has a dedicate logic for handling nested lambdas, where the inner lambda could reference any captures/variables/parameters from the outer lambda, we can shift the responsibility for man

[clang] [Clang] Implement CWG 2628 "Implicit deduction guides should propagate constraints" (PR #111143)

2025-01-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/43 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Handle undeduced auto types in HeuristicResolver (PR #124236)

2025-01-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks, though having to nest five levels of 'if's seems a bit awkward https://github.com/llvm/llvm-project/pull/124236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

<    9   10   11   12   13   14   15   16   17   18   >