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

2024-08-17 Thread Younan Zhang via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

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

2024-08-18 Thread Younan Zhang via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

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

2024-08-18 Thread Younan Zhang via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

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

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

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

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

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

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

[clang] [Clang][NFC] Fix potential null dereference in encodeTypeForFunctionPointerAuth (PR #104737)

2024-08-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 requested changes to this pull request. It looks like T is assumed to be non-null for this function. Please do ensure the reasonableness of the patch if it's made by a static analyzer https://github.com/llvm/llvm-project/pull/104737 ___

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

2024-08-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @mordante I saw some tests are "unexpectedly passed" on ARM platforms: https://buildkite.com/llvm-project/libcxx-ci/builds/37165#0191685f-c770-41d1-a8a4-8819da1b1802 Is that something undesired / why did we mark them XFAIL previously? https://github.com/llvm/llvm-project/pull/10

[clang] [Clang][NFCI] Cleanup the fix for default function substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/104911 (This is one step towards tweaking getTemplateInstantiationArgs() as discussed in https://github.com/llvm/llvm-project/pull/102922) We don't always substitute into default arguments while transforming a functio

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

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

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

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

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/104911 >From c8b8360fe046d38452f71479368c21e217468ddb Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 20 Aug 2024 17:18:35 +0800 Subject: [PATCH 1/2] [Clang][NFCI] Cleanup the fix for default function substitut

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

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

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
@@ -285,7 +286,8 @@ Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function, // If this function was instantiated from a specialized member that is // a function template, we're done. assert(Function->getPrimaryTemplate() && "No function template?"); -

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/104911 >From c8b8360fe046d38452f71479368c21e217468ddb Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 20 Aug 2024 17:18:35 +0800 Subject: [PATCH 1/3] [Clang][NFCI] Cleanup the fix for default function substitut

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
@@ -285,7 +286,8 @@ Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function, // If this function was instantiated from a specialized member that is // a function template, we're done. assert(Function->getPrimaryTemplate() && "No function template?"); -

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
@@ -285,7 +286,8 @@ Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function, // If this function was instantiated from a specialized member that is // a function template, we're done. assert(Function->getPrimaryTemplate() && "No function template?"); -

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-20 Thread Younan Zhang via cfe-commits
@@ -285,7 +286,8 @@ Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function, // If this function was instantiated from a specialized member that is // a function template, we're done. assert(Function->getPrimaryTemplate() && "No function template?"); -

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

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

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

2024-08-21 Thread Younan Zhang via cfe-commits
@@ -285,7 +286,8 @@ Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function, // If this function was instantiated from a specialized member that is // a function template, we're done. assert(Function->getPrimaryTemplate() && "No function template?"); -

[clang] [Clang][NFCI] Cleanup the fix for default function argument substitution (PR #104911)

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

[clang] [Clang][Concepts] Fix the constraint equivalence checking for TemplateTypeParmTypes (PR #102131)

2024-08-21 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @mizvekov suggested in https://github.com/llvm/llvm-project/issues/101735#issuecomment-2273950029 we should try to decouple the constraint checking from the redeclaration chain building, however that is somehow involved. https://github.com/llvm/llvm-project/pull/102131

[clang] [Clang] [NFC] Introduce `DynamicRecursiveASTVisitor` (PR #105195)

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

[clang] [Clang] [NFC] Introduce `DynamicRecursiveASTVisitor` (PR #105195)

2024-08-21 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,252 @@ +#ifndef LLVM_CLANG_AST_DYNAMIC_RECURSIVE_AST_VISITOR_H zyn0217 wrote: Don't forget the license header :) https://github.com/llvm/llvm-project/pull/105195 ___ cfe-commits mailing list cfe-commits@list

[clang] [Clang] [NFC] Introduce `DynamicRecursiveASTVisitor` (PR #105195)

2024-08-21 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,252 @@ +#ifndef LLVM_CLANG_AST_DYNAMIC_RECURSIVE_AST_VISITOR_H +#define LLVM_CLANG_AST_DYNAMIC_RECURSIVE_AST_VISITOR_H + +#include "clang/AST/Attr.h" +#include "clang/AST/ExprConcepts.h" +#include "clang/AST/TypeLoc.h" + +namespace clang { +class ASTContext; + +/// Recu

[clang] [Clang] [NFC] Introduce `DynamicRecursiveASTVisitor` (PR #105195)

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

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

2024-08-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/105617 Follow-up on 8ac140f39. The test `SemaTemplate/default-parm-init.cpp` was introduced since the fix for #80288 and mainly did the following things: - Ensure the default arguments are properly substituted inside

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

2024-08-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited 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][NFC] Consolidate tests for default argument substitution (PR #105617)

2024-08-21 Thread Younan Zhang via cfe-commits
zyn0217 wrote: libcxx failures are unrelated. 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][NFC] order C++ standards in reverse in release notes (PR #104866)

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

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-08-23 Thread Younan Zhang via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [Clang][Concepts] Fix the constraint equivalence checking for TemplateTypeParmTypes (PR #102131)

2024-08-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102131 >From aa99ac433c9d383bfca732c19e5082a555f64c2d Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 6 Aug 2024 20:08:43 +0800 Subject: [PATCH] [Clang][Concepts] Fix the constraint equivalence checking for Tem

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

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

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

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

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

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

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

2024-08-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/105617 >From b837b99272353cb792a9ef19f1f68fd0b4bf8514 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 22 Aug 2024 13:08:12 +0800 Subject: [PATCH] [Clang][NFC] Consolidate tests for default argument substitution

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-24 Thread Younan Zhang via cfe-commits
@@ -972,8 +972,15 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( // equivalence. LocalInstantiationScope ScopeForParameters(S); if (auto *FD = DeclInfo.getDecl()->getAsFunction()) -for (auto *PVD : FD->parameters()) - ScopeForParameters

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102131 >From aa99ac433c9d383bfca732c19e5082a555f64c2d Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 6 Aug 2024 20:08:43 +0800 Subject: [PATCH 1/2] [Clang][Concepts] Fix the constraint equivalence checking for

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

2024-08-25 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); +}("hell

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

2024-08-25 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > We are missing a changelog entry though No release entry because this was intended to be a fix for 19 regression and we now want to backport it :) https://github.com/llvm/llvm-project/pull/89934 ___ cfe-commits mailing list cfe-commi

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-25 Thread Younan Zhang via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { zyn0217 wrote: Can you reference some wording here? Are those hardcoded names

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
@@ -972,8 +972,30 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( // equivalence. LocalInstantiationScope ScopeForParameters(S); if (auto *FD = DeclInfo.getDecl()->getAsFunction()) -for (auto *PVD : FD->parameters()) - ScopeForParameters

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > should we rename SubstituteConstraintExpressionWithoutSatisfaction to make it > clear it only works to compare them? Good idea. How about `SubstituteConstraintExpressionForEquivalenceChecking` then? We can rename it in the next PR. https://github.com/llvm/llvm-project/pull/

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102131 >From aa99ac433c9d383bfca732c19e5082a555f64c2d Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 6 Aug 2024 20:08:43 +0800 Subject: [PATCH 1/3] [Clang][Concepts] Fix the constraint equivalence checking for

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102131 >From aa99ac433c9d383bfca732c19e5082a555f64c2d Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 6 Aug 2024 20:08:43 +0800 Subject: [PATCH 1/4] [Clang][Concepts] Fix the constraint equivalence checking for

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

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

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
zyn0217 wrote: /cherry-pick e6974daa7 https://github.com/llvm/llvm-project/pull/102131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

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

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
zyn0217 wrote: /cherry-pick e6974daa https://github.com/llvm/llvm-project/pull/102131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (PR #102131)

2024-08-25 Thread Younan Zhang via cfe-commits
@@ -972,8 +972,30 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( // equivalence. LocalInstantiationScope ScopeForParameters(S); if (auto *FD = DeclInfo.getDecl()->getAsFunction()) -for (auto *PVD : FD->parameters()) - ScopeForParameters

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

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

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

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

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread Younan Zhang via cfe-commits
@@ -231,3 +231,30 @@ struct type_info { namespace GH93650 { auto func(auto... inputArgs) { return typeid(inputArgs...[0]); } } // namespace GH93650 + + +namespace GH105900 { + +template +struct types { +template +static constexpr __SIZE_TYPE__ get_index() { return id

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

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89934 >From 9eb7a15b385bff343969382c911d744ae954b7f0 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 template

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

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89934 >From 9eb7a15b385bff343969382c911d744ae954b7f0 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 template

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

2024-08-26 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

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/4] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand, return; } + // If this is an implicit deduction guide against an implicitly defined + // constructor, add a note for it. Neither these deduction guides nor their + // corresp

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/5] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? template using Bar = Foo; // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} \ +

[clang] [clang] CTAD: Generate deduction guides for alias templates from non-template explicit deduction guides (PR #96686)

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

[clang] [clang] CTAD: Generate deduction guides for alias templates from non-template explicit deduction guides (PR #96686)

2024-06-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for the patch! I think the overall approach looks good, and with this patch, I also need to remove the assumption in my https://github.com/llvm/llvm-project/pull/96084 that there's always a template decl associated with the deduction guide. https:

[clang] [clang] CTAD: Generate deduction guides for alias templates from non-template explicit deduction guides (PR #96686)

2024-06-25 Thread Younan Zhang via cfe-commits
@@ -3216,6 +3226,44 @@ void DeclareImplicitDeductionGuidesForTypeAlias( Guides.suppressDiagnostics(); for (auto *G : Guides) { +if (auto *DG = dyn_cast(G)) { + // The deduction guide is a non-template function decl, we just clone it. + auto *FunctionType = +

[clang] [clang] CTAD: Generate deduction guides for alias templates from non-template explicit deduction guides (PR #96686)

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

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/6] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/7] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-25 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/8] [Clang] Add diagnostic notes for implcitly generated deductio

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

2024-06-25 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > +1 to get this added to 18.1.9 if there ever is one - especially if the > Android NDK moves to it - the 27 betas fail for me too Sorry, I was unaware we had a scheduled release of 18.1.8 last week. @tstellar @cor3ntin do you think this is worth another 18.x release (presumably

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Younan Zhang via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? template using Bar = Foo; // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} \ +

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Younan Zhang via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? template using Bar = Foo; // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} \ +

[clang] [Clang][AST] Let DeclPrinter print trailing requires expressions for template parameters (PR #96864)

2024-06-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/96864 As discussed in https://github.com/llvm/llvm-project/pull/96084#discussion_r1654629993, it would be nice to present these trailing constraints on template parameters when printing CTAD decls through a DeclPrint

[clang] [Clang][AST] Let DeclPrinter print trailing requires expressions for template parameters (PR #96864)

2024-06-27 Thread Younan Zhang via cfe-commits
@@ -1189,6 +1189,16 @@ void DeclPrinter::printTemplateParameters(const TemplateParameterList *Params, Out << '>'; if (!OmitTemplateKW) Out << ' '; + + if (const Expr *RequiresClause = Params->getRequiresClause()) { zyn0217 wrote: Yeah, you're right,

[clang] [Clang][AST] Let DeclPrinter print trailing requires expressions for template parameters (PR #96864)

2024-06-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96864 >From a5c33bd413d8150d1688240c6b5253b1760cafe1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 27 Jun 2024 15:59:48 +0800 Subject: [PATCH 1/2] [Clang][AST] Let DeclPrinter print trailing requires expressi

[clang] [Clang][AST] Let DeclPrinter print trailing requires expressions for template parameters (PR #96864)

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

[clang] [Sema] LambdaScopeForCallOperatorInstantiationRAII - fix typo in early out logic (PR #96888)

2024-06-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for the patch. While I think this makes sense, it still confuses me whether there was some redundancy in the guard condition. Do we have any situation where `Pattern` is non-null whereas `ParentFD` becomes null? I assume they are always paired, at l

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/9] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Younan Zhang via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? zyn0217 wrote: Good to know that, remove the FIXME now. https://github.com/llvm/llvm-project/pull/96084 ___

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 01/10] [Clang] Add diagnostic notes for implcitly generated deduct

[clang] [Sema] LambdaScopeForCallOperatorInstantiationRAII - fix typo in early out logic (PR #96888)

2024-06-27 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Looks like we have hit the assert in `SemaTemplate/alias-template-with-lambdas.cpp`. I brought that dirty test, and I'll take a look this weekend. https://github.com/llvm/llvm-project/pull/96888 ___ cfe-commits mailing list cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 01/11] [Clang] Add diagnostic notes for implcitly generated deduct

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-28 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thank you folks for the review & suggestion. I plan to merge this PR next week in case @AaronBallman or @cor3ntin has objections. https://github.com/llvm/llvm-project/pull/96084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

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

2024-06-29 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/5] [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-29 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] Substitute for the type aliases inside of a CTAD guide (PR #94740)

2024-06-29 Thread Younan Zhang via cfe-commits
@@ -16,3 +16,73 @@ using T = A::B; using Copy = decltype(copy); using Copy = A::B; + +namespace GH94614 { + +template struct S {}; zyn0217 wrote: Yeah, and I've even tried `#pragma clang __debug dump param,` which doesn't work either... I was expecting we

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

2024-06-29 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] [Sema] LambdaScopeForCallOperatorInstantiationRAII - fix typo in early out logic (PR #96888)

2024-06-29 Thread Younan Zhang via cfe-commits
zyn0217 wrote: So, here is the offending case: ```cpp template concept True = true; template using MeowMeow = decltype([](U...) {}.template operator()(U()...)); void foo() { using T = MeowMeow; } ``` In this example, the lambda does not have the `TypeAliasTemplateDecl` where it is define

[clang] [Sema] LambdaScopeForCallOperatorInstantiationRAII - fix typo in early out logic (PR #96888)

2024-06-29 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thinking more, I still maintain that the check for `ParentFD` is redundant. So, suppose we need to find a case to compromise the previous logic. In that case, we need to find a generic lambda whose `Pattern` is defined inside a function (i.e. `Pattern` is non-null) while its `In

[clang] [Clang] Add captures to the instantiation scope for noexcept specifiers (PR #97166)

2024-06-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/97166 The noexcept specifiers of dependent lambdas would be transformed and rebuilt, where the map of instantiation should also contain captured variables in case they are used from the noexcept specifier. I also unc

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

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

[clang] [clang] Do not substitute parameter pack while retaining the pack expansion (PR #108197)

2024-09-12 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s zyn0217 wrote: Can you move the test to a pre-existing file instead of adding a new one? e.g. somewhere like clang/test/SemaTemplate/pack-deduction.cpp, since this patch is affecting somet

[clang] -ast-dump-decl-types crashes on codes involving concepts #94928 (PR #108142)

2024-09-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. LGTM apart from Aaron’s comments. Thanks for the patch! https://github.com/llvm/llvm-project/pull/108142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [Clang] Avoid transforming lambdas when rebuilding immediate expressions (PR #108693)

2024-09-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/108693 When rebuilding immediate invocations inside `RemoveNestedImmediateInvocation()`, we employed a `TreeTransform` to exercise the traversal. The transformation has a side effect that, for template specialization

[clang] [Clang] Avoid transforming lambdas when rebuilding immediate expressions (PR #108693)

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

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -std=c++2a -triple=x86_64-linux -fsyntax-only %s -verify zyn0217 wrote: You can add another C++20 mode run to clang/test/SemaCXX/static-assert-cxx26.cpp, instead of adding a new file. https://github.com/llvm/llvm-project/pull

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -std=c++2a -triple=x86_64-linux -fsyntax-only %s -verify zyn0217 wrote: I believe so, yes. See the example: clang/test/SemaCXX/constant-expression-cxx2b.cpp https://github.com/llvm/llvm-project/pull/108701 ___

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -std=c++2a -triple=x86_64-linux -fsyntax-only %s -verify zyn0217 wrote: Also, you might want to wrap the case with a namespace referring to the issue number. Furthermore, I think the test should be triaged as a Parser one. Ca

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Can we figure out which PR this regression came from and make sure the code > change makes sense in light of that PR? https://github.com/llvm/llvm-project/pull/102044. We have backported the P2741R3 implementation to C++11. https://github.com/llvm/llvm-project/pull/108701 __

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: So I took a stab at it. In `ParseStaticAssertDeclaration()`, we parsed the message in unclosed  static_assert as a constant expression rather than an unevaluated string literal per the logic on lines 1079-1089. So this approach gives up building an express

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

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

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

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

<    5   6   7   8   9   10   11   12   13   14   >