@@ -10133,7 +10133,8 @@ class Sema final : public SemaBase {
1013310133 ADLCallKind IsADLCandidate = ADLCallKind::NotADL,
1013410134 ConversionSequenceList EarlyConversions = std::nullopt,
1013510135 OverloadCandidateParamOrder PO = {},
10136- bool AggregateCandidateDeduction = false);
10136+ bool AggregateCandidateDeduction = false,
10137+ bool HasMatchedPackOnParmToNonPackOnArg = false);
1013710138
1013810139 /// Add all of the function declarations in the given function set to
1013910140 /// the overload candidate set.
@@ -10168,7 +10169,8 @@ class Sema final : public SemaBase {
1016810169 bool SuppressUserConversions = false,
1016910170 bool PartialOverloading = false,
1017010171 ConversionSequenceList EarlyConversions = std::nullopt,
10171- OverloadCandidateParamOrder PO = {});
10172+ OverloadCandidateParamOrder PO = {},
10173+ bool HasMatchedPackOnParmToNonPackOnArg = false);
1017210174
1017310175 /// Add a C++ member function template as a candidate to the candidate
1017410176 /// set, using template argument deduction to produce an appropriate member
@@ -10214,7 +10216,8 @@ class Sema final : public SemaBase {
1021410216 CXXConversionDecl *Conversion, DeclAccessPair FoundDecl,
1021510217 CXXRecordDecl *ActingContext, Expr *From, QualType ToType,
1021610218 OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit,
10217- bool AllowExplicit, bool AllowResultConversion = true);
10219+ bool AllowExplicit, bool AllowResultConversion = true,
10220+ bool HasMatchedPackOnParmToNonPackOnArg = false);
1021810221
1021910222 /// Adds a conversion function template specialization
1022010223 /// candidate to the overload set, using template argument deduction
@@ -11637,7 +11640,8 @@ class Sema final : public SemaBase {
1163711640 SourceLocation RAngleLoc, unsigned ArgumentPackIndex,
1163811641 SmallVectorImpl<TemplateArgument> &SugaredConverted,
1163911642 SmallVectorImpl<TemplateArgument> &CanonicalConverted,
11640- CheckTemplateArgumentKind CTAK);
11643+ CheckTemplateArgumentKind CTAK, bool PartialOrdering,
11644+ bool *MatchedPackOnParmToNonPackOnArg);
1164111645
1164211646 /// Check that the given template arguments can be provided to
1164311647 /// the given template, converting the arguments along the way.
@@ -11684,7 +11688,8 @@ class Sema final : public SemaBase {
1168411688 SmallVectorImpl<TemplateArgument> &SugaredConverted,
1168511689 SmallVectorImpl<TemplateArgument> &CanonicalConverted,
1168611690 bool UpdateArgsWithConversions = true,
11687- bool *ConstraintsNotSatisfied = nullptr, bool PartialOrderingTTP = false);
11691+ bool *ConstraintsNotSatisfied = nullptr, bool PartialOrderingTTP = false,
11692+ bool *MatchedPackOnParmToNonPackOnArg = nullptr);
1168811693
1168911694 bool CheckTemplateTypeArgument(
1169011695 TemplateTypeParmDecl *Param, TemplateArgumentLoc &Arg,
@@ -11718,7 +11723,9 @@ class Sema final : public SemaBase {
1171811723 /// It returns true if an error occurred, and false otherwise.
1171911724 bool CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
1172011725 TemplateParameterList *Params,
11721- TemplateArgumentLoc &Arg, bool IsDeduced);
11726+ TemplateArgumentLoc &Arg,
11727+ bool PartialOrdering,
11728+ bool *MatchedPackOnParmToNonPackOnArg);
1172211729
1172311730 void NoteTemplateLocation(const NamedDecl &Decl,
1172411731 std::optional<SourceRange> ParamRange = {});
@@ -12229,8 +12236,8 @@ class Sema final : public SemaBase {
1222912236 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
1223012237 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
1223112238 sema::TemplateDeductionInfo &Info,
12232- SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs = nullptr ,
12233- bool PartialOverloading = false ,
12239+ SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs,
12240+ bool PartialOverloading, bool PartialOrdering ,
1223412241 llvm::function_ref<bool()> CheckNonDependent = [] { return false; });
1223512242
1223612243 /// Perform template argument deduction from a function call
@@ -12264,7 +12271,8 @@ class Sema final : public SemaBase {
1226412271 TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef<Expr *> Args,
1226512272 FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info,
1226612273 bool PartialOverloading, bool AggregateDeductionCandidate,
12267- QualType ObjectType, Expr::Classification ObjectClassification,
12274+ bool PartialOrdering, QualType ObjectType,
12275+ Expr::Classification ObjectClassification,
1226812276 llvm::function_ref<bool(ArrayRef<QualType>)> CheckNonDependent);
1226912277
1227012278 /// Deduce template arguments when taking the address of a function
@@ -12417,8 +12425,9 @@ class Sema final : public SemaBase {
1241712425 sema::TemplateDeductionInfo &Info);
1241812426
1241912427 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
12420- TemplateParameterList *PParam, TemplateDecl *AArg,
12421- const DefaultArguments &DefaultArgs, SourceLocation Loc, bool IsDeduced);
12428+ TemplateParameterList *PParam, TemplateDecl *PArg, TemplateDecl *AArg,
12429+ const DefaultArguments &DefaultArgs, SourceLocation ArgLoc,
12430+ bool PartialOrdering, bool *MatchedPackOnParmToNonPackOnArg);
1242212431
1242312432 /// Mark which template parameters are used in a given expression.
1242412433 ///
@@ -12727,6 +12736,9 @@ class Sema final : public SemaBase {
1272712736
1272812737 /// We are instantiating a type alias template declaration.
1272912738 TypeAliasTemplateInstantiation,
12739+
12740+ /// We are performing partial ordering for template template parameters.
12741+ PartialOrderingTTP,
1273012742 } Kind;
1273112743
1273212744 /// Was the enclosing context a non-instantiation SFINAE context?
@@ -12948,6 +12960,12 @@ class Sema final : public SemaBase {
1294812960 TemplateDecl *Entity, BuildingDeductionGuidesTag,
1294912961 SourceRange InstantiationRange = SourceRange());
1295012962
12963+ struct PartialOrderingTTP {};
12964+ /// \brief Note that we are partial ordering template template parameters.
12965+ InstantiatingTemplate(Sema &SemaRef, SourceLocation ArgLoc,
12966+ PartialOrderingTTP, TemplateDecl *PArg,
12967+ SourceRange InstantiationRange = SourceRange());
12968+
1295112969 /// Note that we have finished instantiating this template.
1295212970 void Clear();
1295312971
@@ -13408,7 +13426,8 @@ class Sema final : public SemaBase {
1340813426 bool InstantiateClassTemplateSpecialization(
1340913427 SourceLocation PointOfInstantiation,
1341013428 ClassTemplateSpecializationDecl *ClassTemplateSpec,
13411- TemplateSpecializationKind TSK, bool Complain = true);
13429+ TemplateSpecializationKind TSK, bool Complain = true,
13430+ bool PrimaryHasMatchedPackOnParmToNonPackOnArg = false);
1341213431
1341313432 /// Instantiates the definitions of all of the member
1341413433 /// of the given class, which is an instantiation of a class template
0 commit comments