Skip to content

Commit 9341b5c

Browse files
sdkrystiansmithp35
authored andcommitted
[Clang][NFC] Remove TemplateArgumentList::OnStack (llvm#79760)
This patch removes on-stack `TemplateArgumentList`'s. They were primary used to pass an `ArrayRef<TemplateArgument>` to `Sema::getTemplateInstantiationArgs`, which had a `const TemplateArgumentList*` parameter for the innermost template argument list. Changing this parameter to an `std::optional<ArrayRef<TemplateArgument>>` eliminates the need for on-stack `TemplateArgumentList`'s, which in turn eliminates the need for `TemplateArgumentList` to store a pointer to its template argument storage (which is redundant in almost all cases, as it is an AST allocated type).
1 parent 3c3afc8 commit 9341b5c

File tree

10 files changed

+81
-112
lines changed

10 files changed

+81
-112
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ AST Dumping Potentially Breaking Changes
5151

5252
Clang Frontend Potentially Breaking Changes
5353
-------------------------------------------
54+
- Removed support for constructing on-stack ``TemplateArgumentList``s; interfaces should instead
55+
use ``ArrayRef<TemplateArgument>`` to pass template arguments. Transitioning internal uses to
56+
``ArrayRef<TemplateArgument>`` reduces AST memory usage by 0.4% when compiling clang, and is
57+
expected to show similar improvements on other workloads.
5458

5559
Target OS macros extension
5660
^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/DeclTemplate.h

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ class FixedSizeTemplateParameterListStorage
241241
/// A template argument list.
242242
class TemplateArgumentList final
243243
: private llvm::TrailingObjects<TemplateArgumentList, TemplateArgument> {
244-
/// The template argument list.
245-
const TemplateArgument *Arguments;
246-
247244
/// The number of template arguments in this template
248245
/// argument list.
249246
unsigned NumArguments;
@@ -258,30 +255,11 @@ class TemplateArgumentList final
258255
TemplateArgumentList(const TemplateArgumentList &) = delete;
259256
TemplateArgumentList &operator=(const TemplateArgumentList &) = delete;
260257

261-
/// Type used to indicate that the template argument list itself is a
262-
/// stack object. It does not own its template arguments.
263-
enum OnStackType { OnStack };
264-
265258
/// Create a new template argument list that copies the given set of
266259
/// template arguments.
267260
static TemplateArgumentList *CreateCopy(ASTContext &Context,
268261
ArrayRef<TemplateArgument> Args);
269262

270-
/// Construct a new, temporary template argument list on the stack.
271-
///
272-
/// The template argument list does not own the template arguments
273-
/// provided.
274-
explicit TemplateArgumentList(OnStackType, ArrayRef<TemplateArgument> Args)
275-
: Arguments(Args.data()), NumArguments(Args.size()) {}
276-
277-
/// Produces a shallow copy of the given template argument list.
278-
///
279-
/// This operation assumes that the input argument list outlives it.
280-
/// This takes the list as a pointer to avoid looking like a copy
281-
/// constructor, since this really isn't safe to use that way.
282-
explicit TemplateArgumentList(const TemplateArgumentList *Other)
283-
: Arguments(Other->data()), NumArguments(Other->size()) {}
284-
285263
/// Retrieve the template argument at a given index.
286264
const TemplateArgument &get(unsigned Idx) const {
287265
assert(Idx < NumArguments && "Invalid template argument index");
@@ -301,7 +279,9 @@ class TemplateArgumentList final
301279
unsigned size() const { return NumArguments; }
302280

303281
/// Retrieve a pointer to the template argument list.
304-
const TemplateArgument *data() const { return Arguments; }
282+
const TemplateArgument *data() const {
283+
return getTrailingObjects<TemplateArgument>();
284+
}
305285
};
306286

307287
void *allocateDefaultArgStorageChain(const ASTContext &C);

clang/include/clang/Sema/Sema.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9329,12 +9329,12 @@ class Sema final {
93299329

93309330
TemplateDeductionResult
93319331
DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
9332-
const TemplateArgumentList &TemplateArgs,
9332+
ArrayRef<TemplateArgument> TemplateArgs,
93339333
sema::TemplateDeductionInfo &Info);
93349334

93359335
TemplateDeductionResult
93369336
DeduceTemplateArguments(VarTemplatePartialSpecializationDecl *Partial,
9337-
const TemplateArgumentList &TemplateArgs,
9337+
ArrayRef<TemplateArgument> TemplateArgs,
93389338
sema::TemplateDeductionInfo &Info);
93399339

93409340
TemplateDeductionResult SubstituteExplicitTemplateArguments(
@@ -9507,7 +9507,7 @@ class Sema final {
95079507

95089508
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(
95099509
const NamedDecl *D, const DeclContext *DC = nullptr, bool Final = false,
9510-
const TemplateArgumentList *Innermost = nullptr,
9510+
std::optional<ArrayRef<TemplateArgument>> Innermost = std::nullopt,
95119511
bool RelativeToPrimary = false, const FunctionDecl *Pattern = nullptr,
95129512
bool ForConstraintInstantiation = false,
95139513
bool SkipForSpecialization = false);
@@ -10537,7 +10537,7 @@ class Sema final {
1053710537
bool AtEndOfTU = false);
1053810538
VarTemplateSpecializationDecl *BuildVarTemplateInstantiation(
1053910539
VarTemplateDecl *VarTemplate, VarDecl *FromVar,
10540-
const TemplateArgumentList &TemplateArgList,
10540+
const TemplateArgumentList *PartialSpecArgs,
1054110541
const TemplateArgumentListInfo &TemplateArgsInfo,
1054210542
SmallVectorImpl<TemplateArgument> &Converted,
1054310543
SourceLocation PointOfInstantiation,

clang/lib/AST/DeclTemplate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,7 @@ void TemplateTemplateParmDecl::setDefaultArgument(
871871
// TemplateArgumentList Implementation
872872
//===----------------------------------------------------------------------===//
873873
TemplateArgumentList::TemplateArgumentList(ArrayRef<TemplateArgument> Args)
874-
: Arguments(getTrailingObjects<TemplateArgument>()),
875-
NumArguments(Args.size()) {
874+
: NumArguments(Args.size()) {
876875
std::uninitialized_copy(Args.begin(), Args.end(),
877876
getTrailingObjects<TemplateArgument>());
878877
}

clang/lib/Sema/SemaConcept.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,12 @@ Sema::SetupConstraintCheckingTemplateArgumentsAndScope(
661661
// Collect the list of template arguments relative to the 'primary' template.
662662
// We need the entire list, since the constraint is completely uninstantiated
663663
// at this point.
664-
MLTAL = getTemplateInstantiationArgs(FD, FD->getLexicalDeclContext(),
665-
/*Final=*/false, /*Innermost=*/nullptr,
666-
/*RelativeToPrimary=*/true,
667-
/*Pattern=*/nullptr,
668-
/*ForConstraintInstantiation=*/true);
664+
MLTAL =
665+
getTemplateInstantiationArgs(FD, FD->getLexicalDeclContext(),
666+
/*Final=*/false, /*Innermost=*/std::nullopt,
667+
/*RelativeToPrimary=*/true,
668+
/*Pattern=*/nullptr,
669+
/*ForConstraintInstantiation=*/true);
669670
if (SetupConstraintScope(FD, TemplateArgs, MLTAL, Scope))
670671
return std::nullopt;
671672

@@ -740,7 +741,8 @@ static unsigned
740741
CalculateTemplateDepthForConstraints(Sema &S, const NamedDecl *ND,
741742
bool SkipForSpecialization = false) {
742743
MultiLevelTemplateArgumentList MLTAL = S.getTemplateInstantiationArgs(
743-
ND, ND->getLexicalDeclContext(), /*Final=*/false, /*Innermost=*/nullptr,
744+
ND, ND->getLexicalDeclContext(), /*Final=*/false,
745+
/*Innermost=*/std::nullopt,
744746
/*RelativeToPrimary=*/true,
745747
/*Pattern=*/nullptr,
746748
/*ForConstraintInstantiation=*/true, SkipForSpecialization);
@@ -780,7 +782,7 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction(
780782
const Expr *ConstrExpr) {
781783
MultiLevelTemplateArgumentList MLTAL = S.getTemplateInstantiationArgs(
782784
DeclInfo.getDecl(), DeclInfo.getLexicalDeclContext(), /*Final=*/false,
783-
/*Innermost=*/nullptr,
785+
/*Innermost=*/std::nullopt,
784786
/*RelativeToPrimary=*/true,
785787
/*Pattern=*/nullptr, /*ForConstraintInstantiation=*/true,
786788
/*SkipForSpecialization*/ false);
@@ -1279,11 +1281,9 @@ substituteParameterMappings(Sema &S, NormalizedConstraint &N,
12791281

12801282
static bool substituteParameterMappings(Sema &S, NormalizedConstraint &N,
12811283
const ConceptSpecializationExpr *CSE) {
1282-
TemplateArgumentList TAL{TemplateArgumentList::OnStack,
1283-
CSE->getTemplateArguments()};
12841284
MultiLevelTemplateArgumentList MLTAL = S.getTemplateInstantiationArgs(
12851285
CSE->getNamedConcept(), CSE->getNamedConcept()->getLexicalDeclContext(),
1286-
/*Final=*/false, &TAL,
1286+
/*Final=*/false, CSE->getTemplateArguments(),
12871287
/*RelativeToPrimary=*/true,
12881288
/*Pattern=*/nullptr,
12891289
/*ForConstraintInstantiation=*/true);

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9113,9 +9113,7 @@ Sema::BuildExprRequirement(
91139113

91149114
auto *Param = cast<TemplateTypeParmDecl>(TPL->getParam(0));
91159115

9116-
TemplateArgumentList TAL(TemplateArgumentList::OnStack, Args);
9117-
MultiLevelTemplateArgumentList MLTAL(Param, TAL.asArray(),
9118-
/*Final=*/false);
9116+
MultiLevelTemplateArgumentList MLTAL(Param, Args, /*Final=*/false);
91199117
MLTAL.addOuterRetainedLevels(TPL->getDepth());
91209118
const TypeConstraint *TC = Param->getTypeConstraint();
91219119
assert(TC && "Type Constraint cannot be null here");

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4843,9 +4843,7 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc,
48434843
// the set of specializations, based on the closest partial specialization
48444844
// that it represents. That is,
48454845
VarDecl *InstantiationPattern = Template->getTemplatedDecl();
4846-
TemplateArgumentList TemplateArgList(TemplateArgumentList::OnStack,
4847-
CanonicalConverted);
4848-
TemplateArgumentList *InstantiationArgs = &TemplateArgList;
4846+
const TemplateArgumentList *PartialSpecArgs = nullptr;
48494847
bool AmbiguousPartialSpec = false;
48504848
typedef PartialSpecMatchResult MatchResult;
48514849
SmallVector<MatchResult, 4> Matched;
@@ -4866,7 +4864,7 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc,
48664864
TemplateDeductionInfo Info(FailedCandidates.getLocation());
48674865

48684866
if (TemplateDeductionResult Result =
4869-
DeduceTemplateArguments(Partial, TemplateArgList, Info)) {
4867+
DeduceTemplateArguments(Partial, CanonicalConverted, Info)) {
48704868
// Store the failed-deduction information for use in diagnostics, later.
48714869
// TODO: Actually use the failed-deduction info?
48724870
FailedCandidates.addCandidate().set(
@@ -4919,7 +4917,7 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc,
49194917

49204918
// Instantiate using the best variable template partial specialization.
49214919
InstantiationPattern = Best->Partial;
4922-
InstantiationArgs = Best->Args;
4920+
PartialSpecArgs = Best->Args;
49234921
} else {
49244922
// -- If no match is found, the instantiation is generated
49254923
// from the primary template.
@@ -4931,7 +4929,7 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc,
49314929
// in DoMarkVarDeclReferenced().
49324930
// FIXME: LateAttrs et al.?
49334931
VarTemplateSpecializationDecl *Decl = BuildVarTemplateInstantiation(
4934-
Template, InstantiationPattern, *InstantiationArgs, TemplateArgs,
4932+
Template, InstantiationPattern, PartialSpecArgs, TemplateArgs,
49354933
CanonicalConverted, TemplateNameLoc /*, LateAttrs, StartingScope*/);
49364934
if (!Decl)
49374935
return true;
@@ -4952,7 +4950,7 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc,
49524950

49534951
if (VarTemplatePartialSpecializationDecl *D =
49544952
dyn_cast<VarTemplatePartialSpecializationDecl>(InstantiationPattern))
4955-
Decl->setInstantiationOf(D, InstantiationArgs);
4953+
Decl->setInstantiationOf(D, PartialSpecArgs);
49564954

49574955
checkSpecializationReachability(TemplateNameLoc, Decl);
49584956

@@ -6257,8 +6255,6 @@ bool Sema::CheckTemplateArgumentList(
62576255
TemplateArgs = std::move(NewArgs);
62586256

62596257
if (!PartialTemplateArgs) {
6260-
TemplateArgumentList StackTemplateArgs(TemplateArgumentList::OnStack,
6261-
CanonicalConverted);
62626258
// Setup the context/ThisScope for the case where we are needing to
62636259
// re-instantiate constraints outside of normal instantiation.
62646260
DeclContext *NewContext = Template->getDeclContext();
@@ -6278,7 +6274,7 @@ bool Sema::CheckTemplateArgumentList(
62786274
CXXThisScopeRAII(*this, RD, ThisQuals, RD != nullptr);
62796275

62806276
MultiLevelTemplateArgumentList MLTAL = getTemplateInstantiationArgs(
6281-
Template, NewContext, /*Final=*/false, &StackTemplateArgs,
6277+
Template, NewContext, /*Final=*/false, CanonicalConverted,
62826278
/*RelativeToPrimary=*/true,
62836279
/*Pattern=*/nullptr,
62846280
/*ForConceptInstantiation=*/true);
@@ -9782,8 +9778,8 @@ bool Sema::CheckFunctionTemplateSpecialization(
97829778
// specialization, with the template arguments from the previous
97839779
// specialization.
97849780
// Take copies of (semantic and syntactic) template argument lists.
9785-
const TemplateArgumentList* TemplArgs = new (Context)
9786-
TemplateArgumentList(Specialization->getTemplateSpecializationArgs());
9781+
const TemplateArgumentList *TemplArgs = TemplateArgumentList::CreateCopy(
9782+
Context, Specialization->getTemplateSpecializationArgs()->asArray());
97879783
FD->setFunctionTemplateSpecialization(
97889784
Specialization->getPrimaryTemplate(), TemplArgs, /*InsertPos=*/nullptr,
97899785
SpecInfo->getTemplateSpecializationKind(),

clang/lib/Sema/SemaTemplateDeduction.cpp

Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,17 +2514,6 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams,
25142514
return Sema::TDK_Success;
25152515
}
25162516

2517-
static Sema::TemplateDeductionResult
2518-
DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams,
2519-
const TemplateArgumentList &ParamList,
2520-
const TemplateArgumentList &ArgList,
2521-
TemplateDeductionInfo &Info,
2522-
SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
2523-
return DeduceTemplateArguments(S, TemplateParams, ParamList.asArray(),
2524-
ArgList.asArray(), Info, Deduced,
2525-
/*NumberOfArgumentsMustMatch=*/false);
2526-
}
2527-
25282517
/// Determine whether two template arguments are the same.
25292518
static bool isSameTemplateArg(ASTContext &Context,
25302519
TemplateArgument X,
@@ -2945,21 +2934,22 @@ CheckDeducedArgumentConstraints(Sema &S, TemplateDeclT *Template,
29452934
llvm::SmallVector<const Expr *, 3> AssociatedConstraints;
29462935
Template->getAssociatedConstraints(AssociatedConstraints);
29472936

2948-
bool NeedsReplacement = DeducedArgsNeedReplacement(Template);
2949-
TemplateArgumentList DeducedTAL{TemplateArgumentList::OnStack,
2950-
CanonicalDeducedArgs};
2937+
std::optional<ArrayRef<TemplateArgument>> Innermost;
2938+
// If we don't need to replace the deduced template arguments,
2939+
// we can add them immediately as the inner-most argument list.
2940+
if (!DeducedArgsNeedReplacement(Template))
2941+
Innermost = CanonicalDeducedArgs;
29512942

29522943
MultiLevelTemplateArgumentList MLTAL = S.getTemplateInstantiationArgs(
2953-
Template, Template->getDeclContext(), /*Final=*/false,
2954-
/*InnerMost=*/NeedsReplacement ? nullptr : &DeducedTAL,
2944+
Template, Template->getDeclContext(), /*Final=*/false, Innermost,
29552945
/*RelativeToPrimary=*/true, /*Pattern=*/
29562946
nullptr, /*ForConstraintInstantiation=*/true);
29572947

29582948
// getTemplateInstantiationArgs picks up the non-deduced version of the
29592949
// template args when this is a variable template partial specialization and
29602950
// not class-scope explicit specialization, so replace with Deduced Args
29612951
// instead of adding to inner-most.
2962-
if (NeedsReplacement)
2952+
if (!Innermost)
29632953
MLTAL.replaceInnermostTemplateArguments(Template, CanonicalDeducedArgs);
29642954

29652955
if (S.CheckConstraintSatisfaction(Template, AssociatedConstraints, MLTAL,
@@ -2980,7 +2970,7 @@ static std::enable_if_t<IsPartialSpecialization<T>::value,
29802970
Sema::TemplateDeductionResult>
29812971
FinishTemplateArgumentDeduction(
29822972
Sema &S, T *Partial, bool IsPartialOrdering,
2983-
const TemplateArgumentList &TemplateArgs,
2973+
ArrayRef<TemplateArgument> TemplateArgs,
29842974
SmallVectorImpl<DeducedTemplateArgument> &Deduced,
29852975
TemplateDeductionInfo &Info) {
29862976
// Unevaluated SFINAE context.
@@ -3073,7 +3063,7 @@ FinishTemplateArgumentDeduction(
30733063
// FIXME: Factor out duplication with partial specialization version above.
30743064
static Sema::TemplateDeductionResult FinishTemplateArgumentDeduction(
30753065
Sema &S, TemplateDecl *Template, bool PartialOrdering,
3076-
const TemplateArgumentList &TemplateArgs,
3066+
ArrayRef<TemplateArgument> TemplateArgs,
30773067
SmallVectorImpl<DeducedTemplateArgument> &Deduced,
30783068
TemplateDeductionInfo &Info) {
30793069
// Unevaluated SFINAE context.
@@ -3122,7 +3112,7 @@ static Sema::TemplateDeductionResult FinishTemplateArgumentDeduction(
31223112
/// partial specialization per C++ [temp.class.spec.match].
31233113
Sema::TemplateDeductionResult
31243114
Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
3125-
const TemplateArgumentList &TemplateArgs,
3115+
ArrayRef<TemplateArgument> TemplateArgs,
31263116
TemplateDeductionInfo &Info) {
31273117
if (Partial->isInvalidDecl())
31283118
return TDK_Invalid;
@@ -3144,11 +3134,10 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
31443134

31453135
SmallVector<DeducedTemplateArgument, 4> Deduced;
31463136
Deduced.resize(Partial->getTemplateParameters()->size());
3147-
if (TemplateDeductionResult Result
3148-
= ::DeduceTemplateArguments(*this,
3149-
Partial->getTemplateParameters(),
3150-
Partial->getTemplateArgs(),
3151-
TemplateArgs, Info, Deduced))
3137+
if (TemplateDeductionResult Result = ::DeduceTemplateArguments(
3138+
*this, Partial->getTemplateParameters(),
3139+
Partial->getTemplateArgs().asArray(), TemplateArgs, Info, Deduced,
3140+
/*NumberOfArgumentsMustMatch=*/false))
31523141
return Result;
31533142

31543143
SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end());
@@ -3174,7 +3163,7 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
31743163
/// partial specialization per C++ [temp.class.spec.match].
31753164
Sema::TemplateDeductionResult
31763165
Sema::DeduceTemplateArguments(VarTemplatePartialSpecializationDecl *Partial,
3177-
const TemplateArgumentList &TemplateArgs,
3166+
ArrayRef<TemplateArgument> TemplateArgs,
31783167
TemplateDeductionInfo &Info) {
31793168
if (Partial->isInvalidDecl())
31803169
return TDK_Invalid;
@@ -3197,8 +3186,9 @@ Sema::DeduceTemplateArguments(VarTemplatePartialSpecializationDecl *Partial,
31973186
SmallVector<DeducedTemplateArgument, 4> Deduced;
31983187
Deduced.resize(Partial->getTemplateParameters()->size());
31993188
if (TemplateDeductionResult Result = ::DeduceTemplateArguments(
3200-
*this, Partial->getTemplateParameters(), Partial->getTemplateArgs(),
3201-
TemplateArgs, Info, Deduced))
3189+
*this, Partial->getTemplateParameters(),
3190+
Partial->getTemplateArgs().asArray(), TemplateArgs, Info, Deduced,
3191+
/*NumberOfArgumentsMustMatch=*/false))
32023192
return Result;
32033193

32043194
SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end());
@@ -3427,15 +3417,15 @@ Sema::TemplateDeductionResult Sema::SubstituteExplicitTemplateArguments(
34273417
// specification.
34283418
SmallVector<QualType, 4> ExceptionStorage;
34293419
if (getLangOpts().CPlusPlus17 &&
3430-
SubstExceptionSpec(Function->getLocation(), EPI.ExceptionSpec,
3431-
ExceptionStorage,
3432-
getTemplateInstantiationArgs(
3433-
FunctionTemplate, nullptr, /*Final=*/true,
3434-
/*Innermost=*/SugaredExplicitArgumentList,
3435-
/*RelativeToPrimary=*/false,
3436-
/*Pattern=*/nullptr,
3437-
/*ForConstraintInstantiation=*/false,
3438-
/*SkipForSpecialization=*/true)))
3420+
SubstExceptionSpec(
3421+
Function->getLocation(), EPI.ExceptionSpec, ExceptionStorage,
3422+
getTemplateInstantiationArgs(
3423+
FunctionTemplate, nullptr, /*Final=*/true,
3424+
/*Innermost=*/SugaredExplicitArgumentList->asArray(),
3425+
/*RelativeToPrimary=*/false,
3426+
/*Pattern=*/nullptr,
3427+
/*ForConstraintInstantiation=*/false,
3428+
/*SkipForSpecialization=*/true)))
34393429
return TDK_SubstitutionFailure;
34403430

34413431
*FunctionType = BuildFunctionType(ResultType, ParamTypes,
@@ -5802,10 +5792,8 @@ static bool isAtLeastAsSpecializedAs(Sema &S, QualType T1, QualType T2,
58025792
bool AtLeastAsSpecialized;
58035793
S.runWithSufficientStackSpace(Info.getLocation(), [&] {
58045794
AtLeastAsSpecialized = !FinishTemplateArgumentDeduction(
5805-
S, P2, /*IsPartialOrdering=*/true,
5806-
TemplateArgumentList(TemplateArgumentList::OnStack,
5807-
TST1->template_arguments()),
5808-
Deduced, Info);
5795+
S, P2, /*IsPartialOrdering=*/true, TST1->template_arguments(), Deduced,
5796+
Info);
58095797
});
58105798
return AtLeastAsSpecialized;
58115799
}

0 commit comments

Comments
 (0)