@@ -4457,9 +4457,10 @@ class Sema final : public SemaBase {
44574457 SourceLocation *ArgLocation = nullptr);
44584458
44594459 /// Determine if type T is a valid subject for a nonnull and similar
4460- /// attributes. By default, we look through references (the behavior used by
4461- /// nonnull), but if the second parameter is true, then we treat a reference
4462- /// type as valid.
4460+ /// attributes. Dependent types are considered valid so they can be checked
4461+ /// during instantiation time. By default, we look through references (the
4462+ /// behavior used by nonnull), but if the second parameter is true, then we
4463+ /// treat a reference type as valid.
44634464 bool isValidPointerAttrType(QualType T, bool RefOkay = false);
44644465
44654466 /// AddAssumeAlignedAttr - Adds an assume_aligned attribute to a particular
@@ -10132,7 +10133,8 @@ class Sema final : public SemaBase {
1013210133 ADLCallKind IsADLCandidate = ADLCallKind::NotADL,
1013310134 ConversionSequenceList EarlyConversions = std::nullopt,
1013410135 OverloadCandidateParamOrder PO = {},
10135- bool AggregateCandidateDeduction = false);
10136+ bool AggregateCandidateDeduction = false,
10137+ bool HasMatchedPackOnParmToNonPackOnArg = false);
1013610138
1013710139 /// Add all of the function declarations in the given function set to
1013810140 /// the overload candidate set.
@@ -10167,7 +10169,8 @@ class Sema final : public SemaBase {
1016710169 bool SuppressUserConversions = false,
1016810170 bool PartialOverloading = false,
1016910171 ConversionSequenceList EarlyConversions = std::nullopt,
10170- OverloadCandidateParamOrder PO = {});
10172+ OverloadCandidateParamOrder PO = {},
10173+ bool HasMatchedPackOnParmToNonPackOnArg = false);
1017110174
1017210175 /// Add a C++ member function template as a candidate to the candidate
1017310176 /// set, using template argument deduction to produce an appropriate member
@@ -10213,7 +10216,8 @@ class Sema final : public SemaBase {
1021310216 CXXConversionDecl *Conversion, DeclAccessPair FoundDecl,
1021410217 CXXRecordDecl *ActingContext, Expr *From, QualType ToType,
1021510218 OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit,
10216- bool AllowExplicit, bool AllowResultConversion = true);
10219+ bool AllowExplicit, bool AllowResultConversion = true,
10220+ bool HasMatchedPackOnParmToNonPackOnArg = false);
1021710221
1021810222 /// Adds a conversion function template specialization
1021910223 /// candidate to the overload set, using template argument deduction
@@ -11636,7 +11640,8 @@ class Sema final : public SemaBase {
1163611640 SourceLocation RAngleLoc, unsigned ArgumentPackIndex,
1163711641 SmallVectorImpl<TemplateArgument> &SugaredConverted,
1163811642 SmallVectorImpl<TemplateArgument> &CanonicalConverted,
11639- CheckTemplateArgumentKind CTAK);
11643+ CheckTemplateArgumentKind CTAK, bool PartialOrdering,
11644+ bool *MatchedPackOnParmToNonPackOnArg);
1164011645
1164111646 /// Check that the given template arguments can be provided to
1164211647 /// the given template, converting the arguments along the way.
@@ -11683,7 +11688,8 @@ class Sema final : public SemaBase {
1168311688 SmallVectorImpl<TemplateArgument> &SugaredConverted,
1168411689 SmallVectorImpl<TemplateArgument> &CanonicalConverted,
1168511690 bool UpdateArgsWithConversions = true,
11686- bool *ConstraintsNotSatisfied = nullptr, bool PartialOrderingTTP = false);
11691+ bool *ConstraintsNotSatisfied = nullptr, bool PartialOrderingTTP = false,
11692+ bool *MatchedPackOnParmToNonPackOnArg = nullptr);
1168711693
1168811694 bool CheckTemplateTypeArgument(
1168911695 TemplateTypeParmDecl *Param, TemplateArgumentLoc &Arg,
@@ -11717,7 +11723,9 @@ class Sema final : public SemaBase {
1171711723 /// It returns true if an error occurred, and false otherwise.
1171811724 bool CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
1171911725 TemplateParameterList *Params,
11720- TemplateArgumentLoc &Arg, bool IsDeduced);
11726+ TemplateArgumentLoc &Arg,
11727+ bool PartialOrdering,
11728+ bool *MatchedPackOnParmToNonPackOnArg);
1172111729
1172211730 void NoteTemplateLocation(const NamedDecl &Decl,
1172311731 std::optional<SourceRange> ParamRange = {});
@@ -12228,8 +12236,8 @@ class Sema final : public SemaBase {
1222812236 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
1222912237 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
1223012238 sema::TemplateDeductionInfo &Info,
12231- SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs = nullptr ,
12232- bool PartialOverloading = false ,
12239+ SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs,
12240+ bool PartialOverloading, bool PartialOrdering ,
1223312241 llvm::function_ref<bool()> CheckNonDependent = [] { return false; });
1223412242
1223512243 /// Perform template argument deduction from a function call
@@ -12263,7 +12271,8 @@ class Sema final : public SemaBase {
1226312271 TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef<Expr *> Args,
1226412272 FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info,
1226512273 bool PartialOverloading, bool AggregateDeductionCandidate,
12266- QualType ObjectType, Expr::Classification ObjectClassification,
12274+ bool PartialOrdering, QualType ObjectType,
12275+ Expr::Classification ObjectClassification,
1226712276 llvm::function_ref<bool(ArrayRef<QualType>)> CheckNonDependent);
1226812277
1226912278 /// Deduce template arguments when taking the address of a function
@@ -12416,8 +12425,9 @@ class Sema final : public SemaBase {
1241612425 sema::TemplateDeductionInfo &Info);
1241712426
1241812427 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
12419- TemplateParameterList *PParam, TemplateDecl *AArg,
12420- 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);
1242112431
1242212432 /// Mark which template parameters are used in a given expression.
1242312433 ///
@@ -12726,6 +12736,9 @@ class Sema final : public SemaBase {
1272612736
1272712737 /// We are instantiating a type alias template declaration.
1272812738 TypeAliasTemplateInstantiation,
12739+
12740+ /// We are performing partial ordering for template template parameters.
12741+ PartialOrderingTTP,
1272912742 } Kind;
1273012743
1273112744 /// Was the enclosing context a non-instantiation SFINAE context?
@@ -12947,6 +12960,12 @@ class Sema final : public SemaBase {
1294712960 TemplateDecl *Entity, BuildingDeductionGuidesTag,
1294812961 SourceRange InstantiationRange = SourceRange());
1294912962
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+
1295012969 /// Note that we have finished instantiating this template.
1295112970 void Clear();
1295212971
@@ -13407,7 +13426,8 @@ class Sema final : public SemaBase {
1340713426 bool InstantiateClassTemplateSpecialization(
1340813427 SourceLocation PointOfInstantiation,
1340913428 ClassTemplateSpecializationDecl *ClassTemplateSpec,
13410- TemplateSpecializationKind TSK, bool Complain = true);
13429+ TemplateSpecializationKind TSK, bool Complain = true,
13430+ bool PrimaryHasMatchedPackOnParmToNonPackOnArg = false);
1341113431
1341213432 /// Instantiates the definitions of all of the member
1341313433 /// of the given class, which is an instantiation of a class template
0 commit comments