[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-09-04 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/96023 >From 958703dfc41c6aa186e5129dc804b532b48ef00e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 17 Jun 2024 21:39:08 -0300 Subject: [PATCH] [clang] Finish implementation of P0522 This finishes the clan

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a spec

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a spec

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a spec

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -3284,16 +3345,20 @@ DeduceTemplateArguments(Sema &S, T *Partial, if (Inst.isInvalid()) return TemplateDeductionResult::InstantiationDepth; - if (Trap.hasErrorOccurred()) -return TemplateDeductionResult::SubstitutionFailure; - TemplateDeductionResult Result;

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, TemplateDeductionInfo &Info, SmallVectorImpl &Deduced, bool NumberOfArgumentsMustMatch, PackFold PackFold) {

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Matheus Izvekov via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, TemplateDeductionInfo &Info, SmallVectorImpl &Deduced, bool NumberOfArgumentsMustMatch, PackFold PackFold) {

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread Vlad Serebrennikov via llvm-branch-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/96023 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -8513,64 +8513,46 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, << Template; } + if (!getLangOpts().RelaxedTemplateTemplateArgs) +return !TemplateParameterListsAreEqual( +Template->getTemplateParameters(), Params, /*Compl

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -3284,16 +3345,20 @@ DeduceTemplateArguments(Sema &S, T *Partial, if (Inst.isInvalid()) return TemplateDeductionResult::InstantiationDepth; - if (Trap.hasErrorOccurred()) -return TemplateDeductionResult::SubstitutionFailure; - TemplateDeductionResult Result;

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -6038,14 +6107,23 @@ static bool isAtLeastAsSpecializedAs(Sema &S, QualType T1, QualType T2, return false; const auto *TST1 = cast(T1); - bool AtLeastAsSpecialized; + + Sema::SFINAETrap Trap(S); + + TemplateDeductionResult Result; S.runWithSufficientStackSpace(

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -3351,14 +3416,18 @@ Sema::DeduceTemplateArgumentsFromType(TemplateDecl *TD, QualType FromType, if (Inst.isInvalid()) return TemplateDeductionResult::InstantiationDepth; - if (Trap.hasErrorOccurred()) -return TemplateDeductionResult::SubstitutionFailure; - Te

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a spec

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -3186,20 +3239,36 @@ static TemplateDeductionResult FinishTemplateArgumentDeduction( // Check that we produced the correct argument list. TemplateParameterList *TemplateParams = Template->getTemplateParameters(); + auto notSame = [&](unsigned I, const TemplateArgument

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -6369,27 +6451,88 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs( // be inverted between Ps and As. On non-deduced context, matching needs to // happen both ways, according to [temp.arg.template]p3, but this is // currently implemented as a spec

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, TemplateDeductionInfo &Info, SmallVectorImpl &Deduced, bool NumberOfArgumentsMustMatch, PackFold PackFold) {

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -139,7 +139,7 @@ static TemplateDeductionResult DeduceTemplateArgumentsByTypeMatch( SmallVectorImpl &Deduced, unsigned TDF, bool PartialOrdering = false, bool DeducedFromArrayBound = false); -enum class PackFold { ParameterToArgument, ArgumentToParameter }; +enum c

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, TemplateDeductionInfo &Info, SmallVectorImpl &Deduced, bool NumberOfArgumentsMustMatch, PackFold PackFold) {

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -9934,6 +9935,9 @@ class Sema final : public SemaBase { /// We are instantiating a type alias template declaration. TypeAliasTemplateInstantiation, + + /// We are performing partial ordering for template template parameters. + PartialOrderTTP,

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, TemplateDeductionInfo &Info, SmallVectorImpl &Deduced, bool NumberOfArgumentsMustMatch, PackFold PackFold) {

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
https://github.com/cor3ntin commented: Thanks Matheus. I left a few nitpicky comments. The design looks good to me I think but it's not a trivial change so Ill want to review it more and have other people look at it too. https://github.com/llvm/llvm-project/pull/96023 __

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-19 Thread via llvm-branch-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/96023 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-18 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/96023 >From 03d5720d113ff3ce03694b27d376230d06d7693e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 17 Jun 2024 21:39:08 -0300 Subject: [PATCH] [clang] Finish implementation of P0522 This finishes the clan

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-18 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This finishes the clang implementation of P0522, getting rid of the fallback to the old, pre-P0522 rules. Before this patch, when partial ordering template template par

[llvm-branch-commits] [clang] [clang] Finish implementation of P0522 (PR #96023)

2024-06-18 Thread Matheus Izvekov via llvm-branch-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/96023 This finishes the clang implementation of P0522, getting rid of the fallback to the old, pre-P0522 rules. Before this patch, when partial ordering template template parameters, we would perform, in order: * If