[clang] [clang-tools-extra] [clangd] show lambda name instead of operator() in signature help (PR #101857)

2024-09-06 Thread Younan Zhang via cfe-commits
@@ -876,6 +876,11 @@ class Sema; /// function pointer or reference (C++ [over.call.object]). FunctionDecl *Function; +/// LambdaName - When the OverloadCandidate is for a +/// lambda's operator(), points to the declaration of +/// the lambda variable. +

[clang] [clang-tools-extra] [clangd] show lambda name instead of operator() in signature help (PR #101857)

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

[clang] [Clang] Don't assert non-empty packs for FunctionParmPackExprs (PR #107561)

2024-09-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/107561 >From 92a30ff72fd922df3c29ac31fc2c7d46df1ff84e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 6 Sep 2024 18:35:45 +0800 Subject: [PATCH 1/3] [Clang] Don't assert non-empty packs for FunctionParmPackExpr

[clang] [Clang] Don't assert non-empty packs for FunctionParmPackExprs (PR #107561)

2024-09-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: It's been ~3 days and I'm merging it - feel free to do post-commit reviews. https://github.com/llvm/llvm-project/pull/107561 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [Clang] Don't assert non-empty packs for FunctionParmPackExprs (PR #107561)

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

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

2024-09-09 Thread Younan Zhang via cfe-commits
@@ -14873,41 +14854,6 @@ TreeTransform::TransformLambdaExpr(LambdaExpr *E) { /*IsInstantiation*/ true); SavedContext.pop(); - // Recompute the dependency of the lambda so that we can defer the lambda call - // construction until after

[clang] [Clang] Introduce FunctionParmPackDecl for expanded lambda captures (PR #107995)

2024-09-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/107995 This patch continues the effort of #86265, fixing another issue involving expanded captures that were not able to held off in the process of the inner lambda's transformation. Similar to FunctionParmPackExpr,

[clang] [Clang] Introduce FunctionParmPackDecl for expanded lambda captures (PR #107995)

2024-09-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/107995 >From c97f213bc412dd2a4d6ee5c8e58a82f04dbbd03b Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 10 Sep 2024 17:23:55 +0800 Subject: [PATCH 1/2] [Clang] Introduce FunctionParmPackDecl for expanded lambda c

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -6291,7 +6307,8 @@ bool Parser::isDeclarationSpecifier( bool Parser::isConstructorDeclarator(bool IsUnqualified, bool DeductionGuide, DeclSpec::FriendSpecified IsFriend, const ParsedTemplateInfo *Templ

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -19998,9 +20054,9 @@ bool Sema::DiagIfReachable(SourceLocation Loc, ArrayRef Stmts, // static data member is not syntactically a constant evaluated constant, // but nonetheless is always required to be a constant expression, so we // can skip diagnosing. - // FIXME:

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -18770,12 +18832,6 @@ bool Sema::tryCaptureVariable( if (CapturingFunctionScopes == 0 && (!BuildAndDiagnose || VarDC == DC)) return true; - // Exception: Function parameters are not tied to the function's DeclContext - // until we enter the function definition. Capt

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -19000,7 +19056,7 @@ bool Sema::tryCaptureVariable( Explicit = false; FunctionScopesIndex--; if (IsInScopeDeclarationContext) - DC = ParentDC; + DC = skipRequiresBody(ParentDC); zyn0217 wrote: Hmm, do you have a test for it? e.g. the r

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

2024-09-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks. Just some thoughts/questions in my mind, and I may need more time to understand the PR. https://github.com/llvm/llvm-project/pull/107942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -961,6 +961,7 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( if (MLTAL.getNumSubstitutedLevels() == 0) return ConstrExpr; + MLTAL.setKind(TemplateSubstitutionKind::Rewrite); zyn0217 wrote: I presume this avoids creating Su

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -15257,6 +15264,13 @@ Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D, D.setFunctionDefinitionKind(FunctionDefinitionKind::Definition); Decl *DP = HandleDeclarator(ParentScope, D, TemplateParameterLists); + if (auto *D = DP) { +if (auto *TD = dyn_c

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

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

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -254,6 +254,33 @@ class CXXBaseSpecifier { TypeSourceInfo *getTypeSourceInfo() const { return BaseTypeInfo; } }; +class ContextDeclOrSentinel { + uintptr_t Pointer; + +public: + ContextDeclOrSentinel(Decl *Pointer) : Pointer(uintptr_t(Pointer)) {} + explicit ContextDec

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -18750,18 +18809,21 @@ static void buildLambdaCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI, } } +static auto skipRequiresBody(DeclContext *DC) { + while (DC->isRequiresExprBody()) +DC = DC->getParent(); + return DC; +} + zyn0217 wrote: We could m

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -961,6 +961,7 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( if (MLTAL.getNumSubstitutedLevels() == 0) return ConstrExpr; + MLTAL.setKind(TemplateSubstitutionKind::Rewrite); zyn0217 wrote: I remember I had tried using Rewr

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

2024-09-10 Thread Younan Zhang via cfe-commits
@@ -254,6 +254,33 @@ class CXXBaseSpecifier { TypeSourceInfo *getTypeSourceInfo() const { return BaseTypeInfo; } }; +class ContextDeclOrSentinel { + uintptr_t Pointer; + +public: + ContextDeclOrSentinel(Decl *Pointer) : Pointer(uintptr_t(Pointer)) {} + explicit ContextDec

[clang] [Clang][Parser] Build up QualifiedTemplateName for typo correction (PR #108148)

2024-09-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/108148 Since #93433, we have switched to `QualifiedTemplateName`s in more situations to preserve sugars in diagnostics. However, there is one missed case in typo correction that might not meet the expectation in `Che

[clang] [Clang][Parser] Build up QualifiedTemplateName for typo correction (PR #108148)

2024-09-11 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Even if I think the change is fairly low risk, I'm not sure a > crash-on-invalid is critical enough to backport (we are at ~1 week of the > release) I understand the point, but my thought is that we'd want as less regressions as possible; OTOH, the crash-on-invalid could also

[clang] [Clang][Parser] Build up QualifiedTemplateName for typo correction (PR #108148)

2024-09-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/108148 >From bd6097801e9a822f5b9e49a6f2fb09b999b4a80d Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 11 Sep 2024 14:28:46 +0800 Subject: [PATCH 1/2] [Clang][Parser] Build up QualifiedTemplateName for typo corr

[clang] [Clang][Parser] Build up QualifiedTemplateName for typo correction (PR #108148)

2024-09-11 Thread Younan Zhang via cfe-commits
@@ -3567,7 +3567,10 @@ bool Sema::resolveAssumedTemplateNameAsType(Scope *S, TemplateName &Name, if (Corrected && Corrected.getFoundDecl()) { diagnoseTypo(Corrected, PDiag(diag::err_no_template_suggest) << ATN->getDeclName()); -Name =

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > or if we would implement a `TypeAliasTemplateSpecializationDecl` only for the > benefit of external resugarers. It is not only valuable to external resugarers. Another point that warrants an introduction of it is for unevaluated lambdas. These lambdas e.g. appearing as part o

[clang] Revert "[clang] Reland: Instantiate concepts with sugared template arguments (#101782)" (PR #102551)

2024-08-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (It's #102353) https://github.com/llvm/llvm-project/pull/102551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix mismatch of out-of-line definition of template class (PR #102554)

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

[clang] [Clang][Sema] Fix mismatch of out-of-line definition of template class (PR #102554)

2024-08-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 requested changes to this pull request. I'm sorry but this approach doesn't make sense to me. I have to say that I self-assigned the issue hours before this patch (I don't know when you started working on it because you haven't explained anything either), and that me

[clang] [Clang][Sema] Fix mismatch of out-of-line definition of template class (PR #102554)

2024-08-08 Thread Younan Zhang via cfe-commits
@@ -951,7 +951,8 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( DeclInfo.getDecl(), DeclInfo.getLexicalDeclContext(), /*Final=*/false, /*Innermost=*/std::nullopt, /*RelativeToPrimary=*/true, - /*Pattern=*/nullptr, /*ForConstrain

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/102587 Since 98191d7c, we have been comparing constraints on out-of-line class template declarations by recovering surrounding template arguments from the DeclContext if neither the new declaration nor its template ar

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Note that @jcsxky has a similar patch https://github.com/llvm/llvm-project/pull/102554 that fixes the same thing. I don't intend to contend against him, and admittedly, that patch works. But I don't think that approach is so reasonable because it is hacky in that `ForConstraint

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

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

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102587 >From 62218a472c88764472ffba69ceca1825686fe1b9 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 9 Aug 2024 16:32:30 +0800 Subject: [PATCH 1/2] [Clang][Concepts] Fix a constraint comparison regression for

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @jcsxky Thanks for spotting that. That is indeed a regression and I think that can be resolved by not letting out-of-line specializations contribute to template arguments. https://github.com/llvm/llvm-project/pull/102587 ___ cfe-commit

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
@@ -971,9 +971,12 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( // this may happen while we're comparing two templates' constraint // equivalence. LocalInstantiationScope ScopeForParameters(S); - if (auto *FD = DeclInfo.getDecl()->getAsFunctio

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
@@ -599,3 +599,39 @@ template unsigned long DerivedCollection::index() {} } // namespace GH72557 + +namespace GH102320 { + +template +concept Constrained = true; + +template class C { + template > class D; + template +requires Constrained + class E; +}; + +template

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-09 Thread Younan Zhang via cfe-commits
@@ -599,3 +599,39 @@ template unsigned long DerivedCollection::index() {} } // namespace GH72557 + +namespace GH102320 { + +template +concept Constrained = true; + +template class C { + template > class D; + template +requires Constrained + class E; +}; + +template

[clang] [Clang][Concepts] Fix a constraint comparison regression for out-of-line ClassTemplateDecls (PR #102587)

2024-08-10 Thread Younan Zhang via cfe-commits
@@ -599,3 +599,39 @@ template unsigned long DerivedCollection::index() {} } // namespace GH72557 + +namespace GH102320 { + +template +concept Constrained = true; + +template class C { + template > class D; + template +requires Constrained + class E; +}; + +template

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-11 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > See for example CXXRecordDecl's getLambdaContextDecl function. > Unfortunately there is an issue where we currently only store this lambda > context when we need it for mangling reasons, … Yeah, I remember we use that to store an ImplicitConceptSpecializationDecl as well, not

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

2024-08-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/102857 Some things are not completed yet: - [ ] CWG2369 for lambdas. We currently don't perform the concept checking before the substitution into lambdas because that requires us to put/instantiate captures to the sc

[clang] [Clang][NFCI] Refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/102922 `getTemplateInstantiationArgs()` takes two parameters `ND` and `DC` to determine the starting point of a traversal. Previously, `DC` would be ignored in the presence of `ND`, and the next declaration context wo

[clang] [Clang][NFCI] Refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102922 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs()

[clang] [Clang][NFCI] Refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102922 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs()

[clang] [Clang][NFCI] Refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102922 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH 1/2] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs

[clang] [Clang][NFCI] Refactor getTemplateInstantiationArgs() (PR #102922)

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

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

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

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-13 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > I think I'd need to see how you would use it, to say if this would be the > best approach. (I thought I have explained somewhere, but it seems not. Sorry!) So the basic idea of CWG2369 is to swap the order of the function template substitution and its constraint checking. We

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-13 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > simplify the function to the following signature: I'm afraid we couldn't. We have one reliance on the `DC` parameter in constraint expression comparison, where we're unable to obtain a Decl as that is not formed yet. So dropping the `DC` parameter doesn't work here. If you pr

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-13 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Either refactor that, or just add an internal 'bool' parameter that controls > if the implementation will add the template parameters, and call that from > the 'Innermost' path with adding the arguments disabled. Thinking twice, I think this is probably feasible to go. As an i

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-04-04 Thread Younan Zhang via cfe-commits
@@ -80,6 +80,81 @@ struct Response { return R; } }; + +// Retrieve the primary template for a lambda call operator. It's +// unfortunate that we only have the mappings of call operators rather +// than lambda classes. +const FunctionDecl * +getPrimaryTemplateOfGenericLamb

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

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

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-04-04 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thank you folks for the insightful review! I'm merging this PR now. https://github.com/llvm/llvm-project/pull/82310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-04-04 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I think I'm ready for feedback after around one week of dogfooding myself. https://github.com/llvm/llvm-project/pull/86629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

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

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/87768 None >From eb6c961896646a62f334284093994160d8c0e38e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 5 Apr 2024 19:12:28 +0800 Subject: [PATCH] [clang][Sema] Avoid guessing unexpanded packs' size in getFu

[clang] [clang-tools-extra] [clangd] Fix: exclude insertions at end of CursorPlaceholder in formatting (PR #87746)

2024-04-06 Thread Younan Zhang via cfe-commits
zyn0217 wrote: AFAIK the Windows CI has been rather fragile recently, and I think you could probably ignore it. https://github.com/llvm/llvm-project/pull/87746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/87768 >From bcebf176cd078c59bca9a2301931f0ec072b66c7 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 5 Apr 2024 19:12:28 +0800 Subject: [PATCH] [Clang][Sema] Avoid guessing unexpanded packs' size in getFullyPac

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

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

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

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

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

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

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-04-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Still crash on > > ```c++ > template constexpr auto x = F(); > template constexpr int a() { return 1; } > > template > struct A { > using Func = decltype( > [](T) { > return x<[] constexpr { return a(); }>; > // return x<[] constexpr { return b(); }>; >

[clang] [Sema][NFC] Cleanups after 843cc474f (PR #87996)

2024-04-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/87996 I forgot to tidy up these lines that should've been done in the previous commit, specifically: 1. Merge two `CodeSynthesisContext`s into one in `CheckTemplateIdType`. 2. Remove some gratuitous `Sema::` specifier

[clang] [Sema][NFC] Cleanups after 843cc474f (PR #87996)

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

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-04-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @jcsxky At the glance of the stacktrace, I suspect we probably need some mechanism of deferral codegen while instantiating the enclosing struct. Can you please file a separate issue? https://github.com/llvm/llvm-project/pull/82310 ___

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/87768 >From bcebf176cd078c59bca9a2301931f0ec072b66c7 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 5 Apr 2024 19:12:28 +0800 Subject: [PATCH] [Clang][Sema] Avoid guessing unexpanded packs' size in getFullyPac

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-04-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 01/10] [clangd] Support go-to-definition on type hints. The core p

[clang] [Clang] Substitute for the type aliases inside of a CTAD guide (PR #94740)

2024-06-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/94740 Similar to the approach of handling nested class templates when building a CTAD guide, we substitute the template parameters of a type alias declaration with the instantiating template arguments in order to ensu

[clang] [Clang] Substitute for the type aliases inside of a CTAD guide (PR #94740)

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

[clang] [Clang] Substitute for the type aliases inside of a CTAD guide (PR #94740)

2024-06-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94740 >From 2f60e51f2017e4448047f64983b2f22cdb67e816 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 7 Jun 2024 18:08:10 +0800 Subject: [PATCH 1/2] [Clang] Substitute for the type aliases inside of a CTAD guide

[clang] [Clang] Substitute for the type aliases inside of a CTAD guide (PR #94740)

2024-06-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94740 >From 2f60e51f2017e4448047f64983b2f22cdb67e816 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 7 Jun 2024 18:08:10 +0800 Subject: [PATCH 1/3] [Clang] Substitute for the type aliases inside of a CTAD guide

[clang] [Clang] Substitute for the type aliases inside of a CTAD guide (PR #94740)

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

[clang] [Clang] Fix two issues of CTAD for aggregates (PR #94889)

2024-06-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/94889 Fixes https://github.com/llvm/llvm-project/issues/64625 Fixes https://github.com/llvm/llvm-project/issues/83368 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Su

[clang] [Sema][CTAD] Allow user defined conversion for copy-list-initialization (PR #94752)

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

[clang] [Sema][CTAD] Allow user defined conversion for copy-list-initialization (PR #94752)

2024-06-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for working on this. While I didn't dig into the details in  `DeduceTemplateSpecializationFromInitializer()`, I think the test could be improved before proceeding. I also wish @erichkeane and @hokein could take a look at this because they have more e

[clang] [Sema][CTAD] Allow user defined conversion for copy-list-initialization (PR #94752)

2024-06-08 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,90 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s +namespace std +{ + typedef long unsigned int size_t; +} + +namespace std +{ + template +class initializer_list +{ +public: + typedef _E value_type; + typedef const _

[clang] [Clang] Fix two issues of CTAD for aggregates (PR #94889)

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

[clang] [Clang] Fix two issues of CTAD for aggregates (PR #94889)

2024-06-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/2] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [Clang] Fix two issues of CTAD for aggregates (PR #94889)

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

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-06-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: +1 for being too late because 18.1.7 just got rolled out a few days ago (I thought 18.1.6 was the final version of 18.x!), and there's probably no 18.1.8. https://github.com/llvm/llvm-project/pull/93206 ___ cfe-commits mailing list cfe-

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

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

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/3] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-10 Thread Younan Zhang via cfe-commits
@@ -506,14 +508,19 @@ class InitListChecker { Sema &S, const InitializedEntity &Entity, InitListExpr *IL, QualType &T, bool VerifyOnly, bool TreatUnavailableAsInvalid, bool InOverloadResolution = false, - SmallVectorImpl *AggrDeductionCandidateParamTypes

[clang] [Clang] Substitute for the type aliases inside of a CTAD guide (PR #94740)

2024-06-11 Thread Younan Zhang via cfe-commits
@@ -2220,23 +2220,103 @@ namespace { class ExtractTypeForDeductionGuide : public TreeTransform { llvm::SmallVectorImpl &MaterializedTypedefs; + ClassTemplateDecl *NestedPattern; + const MultiLevelTemplateArgumentList *OuterInstantiationArgs; public: typedef TreeTran

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
@@ -10918,22 +10944,24 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (!(RD->getDefinition() && RD->isAggregate())) return; QualType Ty = Context.getRecordType(RD); - SmallVector ElementTypes; - - InitListChecker CheckInitList(*

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
@@ -335,3 +335,73 @@ namespace TTP { // CHECK-NEXT: `-TemplateArgument type 'T':'type-parameter-0-0'{{$}} // CHECK-NEXT:`-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0{{$}} // CHECK-NEXT: `-TemplateTypeParm {{.+}} 'T'{{$}} + +namespace GH64625

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/4] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
@@ -335,3 +335,73 @@ namespace TTP { // CHECK-NEXT: `-TemplateArgument type 'T':'type-parameter-0-0'{{$}} // CHECK-NEXT:`-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0{{$}} // CHECK-NEXT: `-TemplateTypeParm {{.+}} 'T'{{$}} + +namespace GH64625

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

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

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/5] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @hokein I realized the entire patch could be significantly simplified, in which we just don't need to perform the brace elision on a braced initializer. Can you take a second look at it? https://github.com/llvm/llvm-project/pull/94889

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/6] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [clang][NFC] Add a test for CWG2685 (PR #95206)

2024-06-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/95206 I believe it has been implemented since D139837 "Implements CTAD for aggregates P1816R0 and P2082R1", so this just claims we have already supported it. Plus an update on the dr status page. >From f6503d93891233

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

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

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

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

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-12 Thread Younan Zhang via cfe-commits
@@ -10918,22 +10944,24 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (!(RD->getDefinition() && RD->isAggregate())) return; QualType Ty = Context.getRecordType(RD); - SmallVector ElementTypes; - - InitListChecker CheckInitList(*

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-12 Thread Younan Zhang via cfe-commits
@@ -1449,7 +1449,10 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity, // dependent non-array type or an array type with a value-dependent // bound assert(AggrDeductionCandidateParamTypes); - if (!isa_and_nonnull( + //

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/7] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

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