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

2024-08-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited 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)

2024-08-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review 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)

2024-08-28 Thread Younan Zhang via cfe-commits
@@ -101,6 +101,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 +template +struct B { + static_assert(sizeof(T) == 1); + using type = int; +};

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

2024-08-28 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > (Unassigning myself because I’m not familiar enough w/ the details of > substitution to review this in a meaningful way). No problem :) > That said, I think this is still missing a release note isn’t it? :) Yeah, I realized it the moment after I pushed the last commit, and I

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for working on the refactor! I did a cursory review, mostly on the `getTemplateInstantiationArgs()` part, and the general approach looks plausible. Re @mizvekov : this patch could supersede my refactoring work not only because of the reuse of the lo

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -1056,16 +1052,20 @@ bool Sema::AreConstraintExpressionsEqual(const NamedDecl *Old, bool Sema::FriendConstraintsDependOnEnclosingTemplate(const FunctionDecl *FD) { assert(FD->getFriendObjectKind() && "Must be a friend!"); + FunctionTemplateDecl *FTD = FD->getDescribedFu

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -4682,6 +4683,17 @@ bool Sema::InstantiateDefaultArgument(SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param) { assert(Param->hasUninstantiatedDefaultArg()); + NamedDecl *Pattern = FD; + std::optional> Innermost; + + if

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -171,374 +139,379 @@ bool isLambdaEnclosedByTypeAliasDecl( .TraverseType(Underlying); } -// Add template arguments from a variable template instantiation. -Response -HandleVarTemplateSpec(const VarTemplateSpecializationDecl *VarTemplSpec, -

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -317,7 +317,8 @@ struct ConvertConstructorToDeductionGuideTransform { } if (NestedPattern) - OuterInstantiationArgs = SemaRef.getTemplateInstantiationArgs(Template); + OuterInstantiationArgs = SemaRef.getTemplateInstantiationArgs( + /*D=*/nullptr,

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -1669,25 +1640,43 @@ namespace { ExprResult RebuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, LambdaScopeInfo *LSI) { +#if 1 CXXMethodDecl *MD = LSI->CallOperator; - for (ParmVarDecl *PVD : MD->parameters())

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -827,25 +825,16 @@ buildAssociatedConstraints(Sema &SemaRef, FunctionTemplateDecl *F, // - The occurrence of U in the function parameter is [depth:0, index:0] // - The template parameter of U is [depth:0, index:0] // - // We add the outer template arguments which

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -171,374 +139,379 @@ bool isLambdaEnclosedByTypeAliasDecl( .TraverseType(Underlying); } -// Add template arguments from a variable template instantiation. -Response -HandleVarTemplateSpec(const VarTemplateSpecializationDecl *VarTemplSpec, -

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

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

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -171,374 +139,379 @@ bool isLambdaEnclosedByTypeAliasDecl( .TraverseType(Underlying); } -// Add template arguments from a variable template instantiation. -Response -HandleVarTemplateSpec(const VarTemplateSpecializationDecl *VarTemplSpec, -

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -2112,6 +2078,33 @@ DeclResult Sema::CheckClassTemplate( NewClass->setLexicalDeclContext(CurContext); NewTemplate->setLexicalDeclContext(CurContext); + // Ensure that the template parameter lists are compatible. Skip this check + // for a friend in a dependent context

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

2024-08-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/101020 >From 420705203a72c82446bd491b5766dde5fef116ff Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 29 Jul 2024 22:10:19 +0800 Subject: [PATCH] [Clang][Parser] Fix name lookup of template parameters for out-o

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Also, do you plan to fix https://github.com/llvm/llvm-project/issues/102320 in this or the follow-up patches? https://github.com/llvm/llvm-project/pull/106585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-29 Thread Younan Zhang via cfe-commits
@@ -809,8 +809,9 @@ class RedeclarableTemplateDecl : public TemplateDecl, }; /// Pointer to the common data shared by all declarations of this - /// template. - mutable CommonBase *Common = nullptr; + /// template, and a flag indicating if the template is a member + //

[clang] [Clang][NFC] Consolidate tests for default argument substitution (PR #105617)

2024-08-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/105617 ___ 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-31 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Superseded by https://github.com/llvm/llvm-project/pull/106585. 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-31 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed 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][Concepts] Correct the CurContext for friend declarations (PR #106890)

2024-09-01 Thread Younan Zhang via cfe-commits
@@ -1012,7 +1012,14 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( // possible that e.g. constraints involving C> and C are // perceived identical. std::optional ContextScope; - if (auto *RD = dyn_cast(DeclInfo.getDeclContext())) { + const Dec

[clang] [Clang][Concepts] Correct the CurContext for friend declarations (PR #106890)

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

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-31 Thread Younan Zhang via cfe-commits
@@ -33,11 +33,12 @@ class D{}; // expected-note{{previous definition is here}} template class D{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} expected-e

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

2024-08-31 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the review :) https://github.com/llvm/llvm-project/pull/101020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Concepts] Correct the CurContext for friend declarations (PR #106890)

2024-09-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/106890 `FindInstantiatedDecl()` relies on the `CurContext` to find the corresponding class template instantiation for a class template declaration. Previously, we pushed the semantic declaration context for constraint

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

2024-08-31 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed 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] Workaround dependent source location issues (PR #106925)

2024-09-01 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Does it fix #80210? https://github.com/llvm/llvm-project/pull/106925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

2024-08-31 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/101020 >From 420705203a72c82446bd491b5766dde5fef116ff Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 29 Jul 2024 22:10:19 +0800 Subject: [PATCH 1/3] [Clang][Parser] Fix name lookup of template parameters for o

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

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

[clang] [clang] NFCI: don't check deduced constraints when partial ordering (PR #106882)

2024-08-31 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. LGTM, but please wait for others' opinions before merging. https://github.com/llvm/llvm-project/pull/106882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Clang][Concepts] Correct the CurContext for friend declarations (PR #106890)

2024-09-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/106890 >From 679ece827467a25b14d0a718ac10f221327f5bef Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 1 Sep 2024 14:55:22 +0800 Subject: [PATCH 1/2] [Clang][Concepts] Correct the CurContext for friend declarati

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

2024-08-31 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Closed in favor of https://github.com/llvm/llvm-project/pull/106585 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][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-08-31 Thread Younan Zhang via cfe-commits
@@ -33,11 +33,12 @@ class D{}; // expected-note{{previous definition is here}} template class D{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} expected-e

[clang] [Clang] Fix handling of placeholder variables name in init captures (PR #107055)

2024-09-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. One thing I'm not entirely clear about is why we would end up with two same placeholder `Decl`s in `LookupResult`. It seems that `IdResolver` results in two same duplicate Decls for such case, but I don't know why. (However I'd still appr

[clang] [Clang] Fix handling of placeholder variables name in init captures (PR #107055)

2024-09-03 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I took a cursory look, and it seems that we pushed the same init capture to the scope chain three times: 1. `Sema::ActOnLambdaExpressionAfterIntroducer` https://github.com/llvm/llvm-project/blob/6c59dfb0184aa11ec202f1cd8aee9e971a1565a4/clang/lib/Sema/SemaLambda.cpp#L1212-L1214 2

[clang] [Clang] Fix handling of placeholder variables name in init captures (PR #107055)

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

[clang] [Clang] Fix handling of placeholder variables name in init captures (PR #107055)

2024-09-03 Thread Younan Zhang via cfe-commits
@@ -1323,7 +1323,6 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, if (C->Init.isUsable()) { addInitCapture(LSI, cast(Var), C->Kind == LCK_ByRef); - PushOnScopeChains(Var, CurScope, false); zyn0217 wrote: Yeah, 2 is

[clang] [Clang] Treat default template argument as constant expressions (PR #107073)

2024-09-03 Thread Younan Zhang via cfe-commits
@@ -960,6 +960,8 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { EnterExpressionEvaluationContext ConstantEvaluated( Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated); DefaultArg = Actions.CorrectDelayedTyposInEx

[clang] [Clang] Treat default template argument as constant expressions (PR #107073)

2024-09-03 Thread Younan Zhang via cfe-commits
@@ -960,6 +960,8 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { EnterExpressionEvaluationContext ConstantEvaluated( Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated); DefaultArg = Actions.CorrectDelayedTyposInEx

[clang] [Clang] Treat default template argument as constant expressions (PR #107073)

2024-09-03 Thread Younan Zhang via cfe-commits
@@ -960,6 +960,8 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { EnterExpressionEvaluationContext ConstantEvaluated( Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated); DefaultArg = Actions.CorrectDelayedTyposInEx

[clang] [Clang] Treat default template argument as constant expressions (PR #107073)

2024-09-03 Thread Younan Zhang via cfe-commits
@@ -960,6 +960,8 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { EnterExpressionEvaluationContext ConstantEvaluated( Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated); DefaultArg = Actions.CorrectDelayedTyposInEx

[clang] [Clang] Treat default template argument as constant expressions (PR #107073)

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

[clang] [Clang] Fix handling of placeholder variables name in init captures (PR #107055)

2024-09-03 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I think so, yes. https://github.com/llvm/llvm-project/pull/107055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-08 Thread Younan Zhang via cfe-commits
@@ -113,8 +113,9 @@ namespace Static { static auto g() -> decltype(this->m); // expected-error{{'this' cannot be used in a static member function declaration}} static int h(); - -static int i() noexcept(noexcept(m + 2)); // expected-error{{'this' cannot be im

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/98023 >From 74d7184777e977ab3e83bfcae7e08e550ef32a39 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 8 Jul 2024 21:28:30 +0800 Subject: [PATCH 1/2] [Clang] Ensure the method scope at the late parsing of noexcep

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

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

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-08 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Looks like this caused a regression in `std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp`... I will look into that. https://github.com/llvm/llvm-project/pull/98023 ___ cfe-commits mailing list cfe-comm

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/98023 >From 74d7184777e977ab3e83bfcae7e08e550ef32a39 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 8 Jul 2024 21:28:30 +0800 Subject: [PATCH 1/3] [Clang] Ensure the method scope at the late parsing of noexcep

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/98023 >From 74d7184777e977ab3e83bfcae7e08e550ef32a39 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 8 Jul 2024 21:28:30 +0800 Subject: [PATCH 1/4] [Clang] Ensure the method scope at the late parsing of noexcep

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: So the previous problem was that we ended up exercising `IsInFnTryBlockHandler()` on constructors with `noexcept` specifiers. That function assumes that if we're in a function `DeclContext` (which is brought by `SynthesizedFunctionScope`, which also pushes a `DeclContext`), we w

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

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

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/98023 ___ 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-07-09 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/6] [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-07-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the 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] Substitute for the type aliases inside of a CTAD guide (PR #94740)

2024-07-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed 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] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/98023 >From 74d7184777e977ab3e83bfcae7e08e550ef32a39 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 8 Jul 2024 21:28:30 +0800 Subject: [PATCH 1/5] [Clang] Ensure the method scope at the late parsing of noexcep

[clang] [Concepts] Avoid substituting into constraints for invalid TemplateDecls (PR #75697)

2024-07-11 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Hmmm, actually I'm thinking about whether we can move the check to somewhere in Parser so that these don't end up in the evaluation function. https://github.com/llvm/llvm-project/pull/75697 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang] Refactor: Move CTAD code from SemaTemplate.cpp to a dedicated file, NFC (PR #98524)

2024-07-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thank you! https://github.com/llvm/llvm-project/pull/98524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

2024-07-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/98023 >From 74d7184777e977ab3e83bfcae7e08e550ef32a39 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 8 Jul 2024 21:28:30 +0800 Subject: [PATCH 1/5] [Clang] Ensure the method scope at the late parsing of noexcep

[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

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

[clang] [Clang] Fix parsing of invalid type-requirement (PR #98545)

2024-07-11 Thread Younan Zhang via cfe-commits
@@ -11698,6 +11698,13 @@ Sema::ActOnTypenameType(Scope *S, SourceLocation TypenameLoc, // Construct a dependent template specialization type. assert(DTN && "dependent template has non-dependent name?"); assert(DTN->getQualifier() == SS.getScopeRep()); + ---

[clang] [Clang] Fix parsing of invalid type-requirement (PR #98545)

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

[clang] [Clang] Fix parsing of invalid type-requirement (PR #98545)

2024-07-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks! This makes sense to me. (Curiously GCC and MSVC seem to defer the check until the evaluation. However, I don't think we have to do that in this patch anyway.) https://github.com/llvm/llvm-project/pull/98545 _

[clang] [Clang] Fix parsing of invalid type-requirement (PR #98545)

2024-07-12 Thread Younan Zhang via cfe-commits
@@ -11698,6 +11698,13 @@ Sema::ActOnTypenameType(Scope *S, SourceLocation TypenameLoc, // Construct a dependent template specialization type. assert(DTN && "dependent template has non-dependent name?"); assert(DTN->getQualifier() == SS.getScopeRep()); + ---

[clang] [Clang][NFCI] Remove records of unsatisfied atomic expressions in ConstraintSatisfaction (PR #98654)

2024-07-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/98654 This expression doesn't appear to be ever used, so let's remove it from the data structure. Fixed some spelling issues as well. >From 1f64b3872686054a57618fd584331a56c344c895 Mon Sep 17 00:00:00 2001 From: You

[clang] [Clang][NFCI] Remove records of unsatisfied atomic expressions in ConstraintSatisfaction (PR #98654)

2024-07-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/98654 >From 1f64b3872686054a57618fd584331a56c344c895 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 12 Jul 2024 23:41:18 +0800 Subject: [PATCH 1/2] [Clang][NFC] Remove records of unsatisfied atomic expressions

[clang] [Clang][NFCI] Remove records of unsatisfied atomic expressions in ConstraintSatisfaction (PR #98654)

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

[clang] [Clang] Reconsider the timing of instantiation of local constexpr lambdas (PR #98758)

2024-07-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/98758 In the previous patch https://github.com/llvm/llvm-project/pull/95660, we used a strategy of eagerly instantiating local constexpr lambdas. However, that caused a regression in recursive local lambda calls. Thi

[clang] [Clang] Reconsider the timing of instantiation of local constexpr lambdas (PR #98758)

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

[clang] [Clang] Reconsider the timing of instantiation of local constexpr lambdas (PR #98758)

2024-07-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Curiously, if we move the call to lambda wrapper out of the function, then it would compile even on trunk -- https://gcc.godbolt.org/z/aEcajcEvE I probably overlooked something here. https://github.com/llvm/llvm-project/pull/98758 _

[clang] [Clang] Reconsider the timing of instantiation of local constexpr lambdas (PR #98758)

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

[clang] [Clang] Reconsider the timing of instantiation of local constexpr lambdas (PR #98758)

2024-07-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin I'm stuck here for hours and I think I need some help. So let me explain what happens before #95660. Consider the example that doesn't compile before #95660: ```cpp template constexpr int func(F f) { constexpr bool y = f(1UL); return y; } int main() { auto predi

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

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

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

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

[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)

2024-04-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/90195 >From f708694fc2686684589dca7b8f3738a117fc047e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Apr 2024 19:06:57 +0800 Subject: [PATCH 1/4] [Sema] Avoid an undesired pack expansion while transforming P

[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)

2024-04-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/90195 >From f708694fc2686684589dca7b8f3738a117fc047e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Apr 2024 19:06:57 +0800 Subject: [PATCH 1/5] [Sema] Avoid an undesired pack expansion while transforming P

[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)

2024-04-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/90195 >From f708694fc2686684589dca7b8f3738a117fc047e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Apr 2024 19:06:57 +0800 Subject: [PATCH 1/6] [Sema] Avoid an undesired pack expansion while transforming P

[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-03 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin @erichkeane Any chance we can move forward with this review? I appreciate your feedback! https://github.com/llvm/llvm-project/pull/89019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

2024-05-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86265 >From 6e7b38b3e3f781e11db2fa5d552fdfb6123609df Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 22 Mar 2024 17:34:08 +0800 Subject: [PATCH 1/5] [Sema] Preserve ContainsUnexpandedParameterPack in TransformL

[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

2024-05-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86265 >From 6e7b38b3e3f781e11db2fa5d552fdfb6123609df Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 22 Mar 2024 17:34:08 +0800 Subject: [PATCH 1/6] [Sema] Preserve ContainsUnexpandedParameterPack in TransformL

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/6] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-03 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > This is introducing a new type that has a pretty subtle difference vs others. > Can we have some documentation in the internals manual explaining the > difference? > > Code wise, I think this looks fine. Yeah, I added some explanation to the document of `UnresolvedLookupExpr`

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/7] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/7] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-05 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @aganea Oops, this is an oversight I think, because I don't build lldb locally nor run its tests... I'm proposing a PR https://github.com/llvm/llvm-project/pull/91132, can you help me confirm if that works? https://github.com/llvm/llvm-project/pull/89019 __

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I remembered @HighCommander4 had filed a similar PR at https://github.com/llvm/llvm-project/pull/77556. Is this one separate, or are they actually the same (i.e. both are salvaged from https://reviews.llvm.org/D93829)? https://github.com/llvm/llvm-project/pull/91191 ___

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Seems nothing gets reviewed anymore these days. Yeah, and unfortunately folks who are qualified/versed in clangd indices don't have enough bandwidths recently, nor does the author @HighCommander4. https://github.com/llvm/llvm-project/pull/91191

[clang] [Clang] Implement __reference_converts_from_temporary (PR #91199)

2024-05-06 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cjdb said he had discarded the implementation of this intrinsic in  https://reviews.llvm.org/D135341 because he thought this was not as trivial as the `construct` version. Given that we have lost all the Phab histories, I think it'd be better to invite @cjdb to take a look at th

[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-05-07 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Gently ping @cor3ntin https://github.com/llvm/llvm-project/pull/89934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

2024-05-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86265 >From 6e7b38b3e3f781e11db2fa5d552fdfb6123609df Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 22 Mar 2024 17:34:08 +0800 Subject: [PATCH 1/7] [Sema] Preserve ContainsUnexpandedParameterPack in TransformL

[clang-tools-extra] [clangd] Add config option to allow detection of unused system headers (PR #87208)

2024-05-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: I think I'm fine with it as-is, but we probably need include-cleaner folks to approve it. (That means you probably have to wait a few more weeks for them, unfortunately.) https://github.com/llvm/llvm-project/pull/87208 _

[clang] [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (PR #91628)

2024-05-09 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/91628 Fixes https://github.com/llvm/llvm-project/issues/88142 >From 4b487ea33c33f53b5070f99965d0a9234ccb4138 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 May 2024 01:09:29 +0800 Subject: [PATCH] [Clang][S

[clang] [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (PR #91628)

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

[clang] [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (PR #91628)

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

[clang] [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (PR #91628)

2024-05-10 Thread Younan Zhang via cfe-commits
@@ -2583,11 +2580,27 @@ struct ConvertConstructorToDeductionGuideTransform { //-- The types of the function parameters are those of the constructor. for (auto *OldParam : TL.getParams()) { - ParmVarDecl *NewParam = - transformFunctionTypeParam(OldPara

[clang] [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (PR #91628)

2024-05-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/91628 >From 4b487ea33c33f53b5070f99965d0a9234ccb4138 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 10 May 2024 01:09:29 +0800 Subject: [PATCH 1/2] [Clang][Sema] Revise the transformation of CTAD parameters of

[clang] [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (PR #91628)

2024-05-10 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I'm merging it now - if something breaks and I'm not in front of my computer, feel free to revert then. https://github.com/llvm/llvm-project/pull/91628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

<    3   4   5   6   7   8   9   10   11   12   >