[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -7216,9 +7216,30 @@ TreeTransform::TransformElaboratedType(TypeLocBuilder , return QualType(); } - QualType NamedT = getDerived().TransformType(TLB, TL.getNamedTypeLoc()); - if (NamedT.isNull()) -return QualType(); + QualType NamedT; + if

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -28,16 +28,17 @@ namespace PR12884_original { typedef int arg; }; struct C { - typedef B::X x; // precxx17-warning{{missing 'typename' prior to dependent type name B::X; implicit 'typename' is a C++20 extension}} zyn0217 wrote: A

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -7216,9 +7216,30 @@ TreeTransform::TransformElaboratedType(TypeLocBuilder , return QualType(); } - QualType NamedT = getDerived().TransformType(TLB, TL.getNamedTypeLoc()); - if (NamedT.isNull()) -return QualType(); + QualType NamedT; + if

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/93404 The issue with the previous implementation bc31be7 was that getApproximateType could potentially return a null QualType for a dereferencing operator, which is not what its caller wants. >From

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

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -1576,7 +1576,10 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( TrailingReturnTypeLoc, ), std::move(Attributes), DeclEndLoc); -Actions.ActOnLambdaClosureQualifiers(Intro, MutableLoc); +// We have called

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

2024-05-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93206 >From 658e9d46adf6dd79aa6aef03a1817444a880348a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 23 May 2024 22:35:11 +0800 Subject: [PATCH] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas

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

2024-05-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/93206 ___ 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-05-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/93206 ___ 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-23 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/9] [Sema] Preserve ContainsUnexpandedParameterPack in

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-23 Thread Younan Zhang via cfe-commits
@@ -111,6 +111,14 @@ def warn_cxx98_compat_raw_string_literal : Warning< "raw string literals are incompatible with C++98">, InGroup, DefaultIgnore; +def warn_cxx26_compat_raw_string_literal_character_set : Warning< + "'%0'in a raw string literal delimiter is

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-23 Thread Younan Zhang via cfe-commits
@@ -111,6 +111,14 @@ def warn_cxx98_compat_raw_string_literal : Warning< "raw string literals are incompatible with C++98">, InGroup, DefaultIgnore; +def warn_cxx26_compat_raw_string_literal_character_set : Warning< + "'%0'in a raw string literal delimiter is

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

2024-05-23 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (What's going on with the pre-commit CI? Does it disappear?) https://github.com/llvm/llvm-project/pull/93206 ___ 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-05-23 Thread Younan Zhang via cfe-commits
@@ -1036,6 +1036,7 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer , // be dependent, because there are template parameters in scope. CXXRecordDecl::LambdaDependencyKind LambdaDependencyKind = CXXRecordDecl::LDK_Unknown; +

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

2024-05-23 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Unfortunately, @l1nxy told me privately that he will not take over that patch as anticipated. So I hope I can continue the work. I'll add a release note and supplement some comments tomorrow. https://github.com/llvm/llvm-project/pull/93206

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

2024-05-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/93206 This patch picks up #78598 with the hope that we can address such crashes in `tryCaptureVariable` for unevaluated lambdas. Fixes #88081 Fixes #69307 Fixes #91633 Fixes #90669 Fixes #89496 >From

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

2024-05-22 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @HighCommander4 No problem, I'm always delighted to receive responses! However it might take me some time to pick up my thoughts, as the patch has been a while. Anyway, I will try to revive this patch in the next few days and let's see if we can make it into clangd 19.

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

2024-05-21 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > It seems this change cause https://godbolt.org/z/311nb6xYe to fail. Could you > please take look? > Also: > https://godbolt.org/z/bYs7Y9v11 I don't see any justification that these examples should compile: the first example is a typical one handled by #90152 (from the

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

2024-05-21 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @jyu2-git Are you sure this is the patch you’re looking for? The diagnostic there is completely unrelated and I think the right patch is https://github.com/llvm/llvm-project/pull/90152. https://github.com/llvm/llvm-project/pull/89019

[clang-tools-extra] [clangd] Reduce instantiation depth in `infinite-instantiations.test` (PR #92888)

2024-05-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks! I added that test to check if the instantiation stack guard takes effect in clangd. And the change makes sense to me. https://github.com/llvm/llvm-project/pull/92888 ___ cfe-commits

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

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

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-20 Thread Younan Zhang via cfe-commits
@@ -2157,11 +2157,11 @@ void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) { void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) { VisitExpr(E); Record.push_back(E->TransformedExpressions); + Record.push_back(E->EmptyPack);

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/92385 >From 7acbb1dd89dbe266c3e53ab30178ac570722c759 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 16 May 2024 19:06:25 +0800 Subject: [PATCH 1/4] [Clang][Sema] Avoid pack expansion for expanded empty

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-20 Thread Younan Zhang via cfe-commits
@@ -2157,11 +2157,11 @@ void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) { void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) { VisitExpr(E); Record.push_back(E->TransformedExpressions); + Record.push_back(E->EmptyPack);

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/92385 >From 7acbb1dd89dbe266c3e53ab30178ac570722c759 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 16 May 2024 19:06:25 +0800 Subject: [PATCH 1/3] [Clang][Sema] Avoid pack expansion for expanded empty

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
@@ -4377,15 +4377,20 @@ class PackIndexingExpr final // The pack being indexed, followed by the index Stmt *SubExprs[2]; - size_t TransformedExpressions; + // The size of the trailing expressions. + unsigned TransformedExpressions : 31; zyn0217 wrote:

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

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

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
@@ -4377,15 +4377,20 @@ class PackIndexingExpr final // The pack being indexed, followed by the index Stmt *SubExprs[2]; - size_t TransformedExpressions; + // The size of the trailing expressions. + unsigned TransformedExpressions : 31; zyn0217 wrote:

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
@@ -2157,11 +2157,11 @@ void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) { void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) { VisitExpr(E); Record.push_back(E->TransformedExpressions); + Record.push_back(E->EmptyPack);

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: @cor3ntin PTAL. Thanks! https://github.com/llvm/llvm-project/pull/92385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/92385 >From 7acbb1dd89dbe266c3e53ab30178ac570722c759 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 16 May 2024 19:06:25 +0800 Subject: [PATCH 1/2] [Clang][Sema] Avoid pack expansion for expanded empty

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

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

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Younan Zhang via cfe-commits
@@ -723,6 +723,7 @@ Bug Fixes to C++ Support - Clang now ignores template parameters only used within the exception specification of candidate function templates during partial ordering when deducing template arguments from a function declaration or when taking the

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/92425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > So, I think the correct fix is to propagate dependence in > ASTContext::getUnconstrainedType. I have a branch that implements this here. > WDYT @erichkeane @cor3ntin @zyn0217 That looks similar to the approach which I investigated some time ago. The difference is that I

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-16 Thread Younan Zhang via cfe-commits
@@ -4381,11 +4381,13 @@ class PackIndexingExpr final PackIndexingExpr(QualType Type, SourceLocation EllipsisLoc, SourceLocation RSquareLoc, Expr *PackIdExpr, Expr *IndexExpr, - ArrayRef SubstitutedExprs = {}) +

[clang] [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (PR #92385)

2024-05-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/92385 We previously doubled the id-expression expansion, even when the pack was expanded to empty. The previous condition for determining whether we should expand couldn't distinguish between cases where 'the

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

2024-05-14 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

[clang] [clang-tools-extra] [Clang] Retain the angle loci for invented template parameters of constraints (PR #92104)

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

[clang] [clang-tools-extra] [Clang] Retain the angle loci for invented template parameters of constraints (PR #92104)

2024-05-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the review! The Linux CI is green, so I presume so is the sluggish Windows CI. Landing it now. https://github.com/llvm/llvm-project/pull/92104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-05-14 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

[clang] [clang-tools-extra] [Clang] Retain the angle loci for invented template parameters of constraints (PR #92104)

2024-05-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/92104 >From d9c0121067162ffb68bc70b9a0a3f10e0b05674c Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 14 May 2024 19:46:20 +0800 Subject: [PATCH 1/2] [Clang] Retain the angle loci for invented template

[clang] [clang-tools-extra] [Clang] Retain the angle loci for invented template parameters of constraints (PR #92104)

2024-05-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/92104 Clangd uses it to determine whether the argument is within the selection range. Fixes https://github.com/clangd/clangd/issues/2033 >From d9c0121067162ffb68bc70b9a0a3f10e0b05674c Mon Sep 17 00:00:00 2001 From:

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks for the prompt fix! I think this looks good now, but please wait for @erichkeane for the final stamp. https://github.com/llvm/llvm-project/pull/91933 ___ cfe-commits mailing list

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-13 Thread Younan Zhang via cfe-commits
@@ -9806,7 +9806,7 @@ QualType Sema::BuildCountAttributedArrayType(QualType WrappedTy, /// that expression, according to the rules in C++11 /// [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18. QualType Sema::getDecltypeForExpr(Expr *E) { - if (E->isTypeDependent()) + if

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-13 Thread Younan Zhang via cfe-commits
@@ -376,6 +376,9 @@ ExprDependence clang::computeDependence(PackExpansionExpr *E) { ExprDependence clang::computeDependence(PackIndexingExpr *E) { ExprDependence D = E->getIndexExpr()->getDependence(); + if (D & ExprDependence::Value) +D |=

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-13 Thread Younan Zhang via cfe-commits
@@ -376,6 +376,9 @@ ExprDependence clang::computeDependence(PackExpansionExpr *E) { ExprDependence clang::computeDependence(PackIndexingExpr *E) { ExprDependence D = E->getIndexExpr()->getDependence(); + if (D & ExprDependence::Value) +D |=

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Younan Zhang via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Younan Zhang via cfe-commits
@@ -2257,6 +2257,11 @@ void StmtProfiler::VisitSubstNonTypeTemplateParmExpr( const SubstNonTypeTemplateParmExpr *E) { // Profile exactly as the replacement expression. Visit(E->getReplacement()); + if (auto *NTTP = + dyn_cast_if_present(E->getParameter());

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Younan Zhang via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[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 = -

[clang] [AST] Print the separator "," for template arguments in ConceptReference::print (PR #91750)

2024-05-10 Thread Younan Zhang via cfe-commits
@@ -24,6 +24,7 @@ add_clang_unittest(ASTTests CommentLexer.cpp CommentParser.cpp CommentTextTest.cpp + ConceptPrinterTest.cpp zyn0217 wrote: Note: we probably want to update the gn build as well:

[clang] [AST] Print the separator "," for template arguments in ConceptReference::print (PR #91750)

2024-05-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks! I'm surprised that this part was missing previously... https://github.com/llvm/llvm-project/pull/91750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [AST] Print the separator "," for template arguments in ConceptReference::print (PR #91750)

2024-05-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/91750 ___ 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
https://github.com/zyn0217 closed 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
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

[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

[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 = -

[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-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 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-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] [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

[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] [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

[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-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] [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] [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-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

[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

[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

[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

[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

[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

[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

[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] [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

[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

[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

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

2024-04-30 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin Mind looking at it again? Thanks so much! 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-04-28 Thread Younan Zhang via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; +

[clang] [Clang][Sema] Fix a bug on template partial specialization with issue on deduction of nontype tempalte parameter (PR #90376)

2024-04-28 Thread Younan Zhang via cfe-commits
@@ -8508,6 +8507,16 @@ Sema::BuildExpressionFromDeclTemplateArgument(const TemplateArgument , } else { assert(ParamType->isReferenceType() && "unexpected type for decl template argument"); +if (ParamType->isLValueReferenceType()) + if

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

2024-04-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited 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] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)

2024-04-28 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/3] [Sema] Avoid an undesired pack expansion while transforming

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

2024-04-28 Thread Younan Zhang via cfe-commits
@@ -160,3 +160,22 @@ namespace GH88929 { using E = P...[0]; // expected-error {{unknown type name 'P'}} \ // expected-error {{expected ';' after alias declaration}} } + +namespace GH88925 { +template struct S {}; + +template struct sequence {}; +

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

2024-04-27 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/3] [Sema] Avoid an undesired pack expansion while transforming

[clang-tools-extra] [clangd] Show definition of underlying struct when hovering over a typedef (PR #89570)

2024-04-26 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > (I still need to figure out how to do proper stacked PRs...) AFAIK, not possible unless our release manager installs e.g. [such an application](https://github.com/marketplace/stacked-pull-requests) to the repository; but candidly, I have never used it before so I have no idea

[clang-tools-extra] [clangd] Show definition of underlying struct when hovering over a typedef (PR #89570)

2024-04-26 Thread Younan Zhang via cfe-commits
@@ -136,6 +136,41 @@ std::string getNamespaceScope(const Decl *D) { return ""; } +void printDeclAndWrappers(const TypedefNameDecl *TND, + llvm::raw_string_ostream , PrintingPolicy PP) { + TND->print(OS, PP); + const Decl *LastPrintedDecl = TND; +

[clang-tools-extra] [clangd] Show definition of underlying struct when hovering over a typedef (PR #89570)

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

[clang-tools-extra] [clangd] Show definition of underlying struct when hovering over a typedef (PR #89570)

2024-04-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for working on this! One thought from me. https://github.com/llvm/llvm-project/pull/89570 ___ 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-26 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/2] [Sema] Avoid an undesired pack expansion while transforming

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

2024-04-26 Thread Younan Zhang via cfe-commits
@@ -160,3 +160,22 @@ namespace GH88929 { using E = P...[0]; // expected-error {{unknown type name 'P'}} \ // expected-error {{expected ';' after alias declaration}} } + +namespace GH88925 { +template struct S {}; + +template struct sequence {}; +

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

2024-04-26 Thread Younan Zhang via cfe-commits
@@ -160,3 +160,22 @@ namespace GH88929 { using E = P...[0]; // expected-error {{unknown type name 'P'}} \ // expected-error {{expected ';' after alias declaration}} } + +namespace GH88925 { +template struct S {}; + +template struct sequence {}; +

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

2024-04-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/90195 Fixes https://github.com/llvm/llvm-project/issues/88925 >From f708694fc2686684589dca7b8f3738a117fc047e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Apr 2024 19:06:57 +0800 Subject: [PATCH] [Sema]

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

2024-04-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review 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] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-04-24 Thread Younan Zhang via cfe-commits
@@ -91,15 +91,60 @@ void bar() { namespace GH82104 { -template int Zero = 0; +template int Value = sizeof...(D); -template -using T14 = decltype([]() { return Zero; }()); +template +using T14 = decltype([](auto Param) { + return Value + V + (int)sizeof(Param);

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

2024-04-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89934 >From 92f8cfb255a549769c39327239c69edd6b2e947e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 24 Apr 2024 20:54:58 +0800 Subject: [PATCH 1/3] [Clang][Sema] Revisit the lambda within a type alias

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

2024-04-24 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > FYI in my issue, even if the lambda didn't appear as part of the default > argument, I was [still able to trigger the > bug](https://godbolt.org/z/4KrEMTTdd). Noting in case this fix only resolves > the case of lambdas in default template arguments, and not passed in >

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

2024-04-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89934 >From 92f8cfb255a549769c39327239c69edd6b2e947e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 24 Apr 2024 20:54:58 +0800 Subject: [PATCH 1/2] [Clang][Sema] Revisit the lambda within a type alias

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

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

  1   2   3   4   5   6   >