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
@@ -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
@@ -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
@@ -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
@@ -3284,16 +3345,20 @@ DeduceTemplateArguments(Sema &S, T *Partial,
if (Inst.isInvalid())
return TemplateDeductionResult::InstantiationDepth;
- if (Trap.hasErrorOccurred())
-return TemplateDeductionResult::SubstitutionFailure;
-
TemplateDeductionResult Result;
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList
*TemplateParams,
TemplateDeductionInfo &Info,
SmallVectorImpl &Deduced,
bool NumberOfArgumentsMustMatch, PackFold PackFold) {
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList
*TemplateParams,
TemplateDeductionInfo &Info,
SmallVectorImpl &Deduced,
bool NumberOfArgumentsMustMatch, PackFold PackFold) {
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
@@ -8513,64 +8513,46 @@ bool
Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
<< Template;
}
+ if (!getLangOpts().RelaxedTemplateTemplateArgs)
+return !TemplateParameterListsAreEqual(
+Template->getTemplateParameters(), Params, /*Compl
@@ -3284,16 +3345,20 @@ DeduceTemplateArguments(Sema &S, T *Partial,
if (Inst.isInvalid())
return TemplateDeductionResult::InstantiationDepth;
- if (Trap.hasErrorOccurred())
-return TemplateDeductionResult::SubstitutionFailure;
-
TemplateDeductionResult Result;
@@ -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(
@@ -3351,14 +3416,18 @@ Sema::DeduceTemplateArgumentsFromType(TemplateDecl *TD,
QualType FromType,
if (Inst.isInvalid())
return TemplateDeductionResult::InstantiationDepth;
- if (Trap.hasErrorOccurred())
-return TemplateDeductionResult::SubstitutionFailure;
-
Te
@@ -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
@@ -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
@@ -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
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList
*TemplateParams,
TemplateDeductionInfo &Info,
SmallVectorImpl &Deduced,
bool NumberOfArgumentsMustMatch, PackFold PackFold) {
@@ -139,7 +139,7 @@ static TemplateDeductionResult
DeduceTemplateArgumentsByTypeMatch(
SmallVectorImpl &Deduced, unsigned TDF,
bool PartialOrdering = false, bool DeducedFromArrayBound = false);
-enum class PackFold { ParameterToArgument, ArgumentToParameter };
+enum c
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList
*TemplateParams,
TemplateDeductionInfo &Info,
SmallVectorImpl &Deduced,
bool NumberOfArgumentsMustMatch, PackFold PackFold) {
@@ -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,
@@ -2513,49 +2545,76 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList
*TemplateParams,
TemplateDeductionInfo &Info,
SmallVectorImpl &Deduced,
bool NumberOfArgumentsMustMatch, PackFold PackFold) {
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
__
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
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
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
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
25 matches
Mail list logo