Skip to content

Commit 671976d

Browse files
committed
Use UnsignedOrNone
1 parent 7270bac commit 671976d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

clang/lib/Sema/SemaConcept.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ static bool CheckFunctionConstraintsWithoutInstantiation(
10641064
Sema &SemaRef, SourceLocation PointOfInstantiation,
10651065
FunctionTemplateDecl *Template, ArrayRef<TemplateArgument> TemplateArgs,
10661066
ConstraintSatisfaction &Satisfaction) {
1067-
SmallVector<const Expr *, 3> TemplateAC;
1067+
SmallVector<AssociatedConstraint, 3> TemplateAC;
10681068
Template->getAssociatedConstraints(TemplateAC);
10691069
if (TemplateAC.empty()) {
10701070
Satisfaction.IsSatisfied = true;

clang/lib/Sema/SemaTemplateInstantiate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,9 +1989,9 @@ bool TemplateInstantiator::maybeInstantiateFunctionParameterToScope(
19891989

19901990
bool ShouldExpand = false;
19911991
bool RetainExpansion = false;
1992-
std::optional<unsigned> OrigNumExpansions =
1992+
UnsignedOrNone OrigNumExpansions =
19931993
ExpansionTL.getTypePtr()->getNumExpansions();
1994-
std::optional<unsigned> NumExpansions = OrigNumExpansions;
1994+
UnsignedOrNone NumExpansions = OrigNumExpansions;
19951995
if (TryExpandParameterPacks(ExpansionTL.getEllipsisLoc(),
19961996
Pattern.getSourceRange(), Unexpanded,
19971997
ShouldExpand, RetainExpansion, NumExpansions))
@@ -2001,7 +2001,7 @@ bool TemplateInstantiator::maybeInstantiateFunctionParameterToScope(
20012001
"Shouldn't preserve pack expansion when evaluating constraints");
20022002
ExpandingFunctionParameterPack(OldParm);
20032003
for (unsigned I = 0; I != *NumExpansions; ++I) {
2004-
Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I);
2004+
Sema::ArgPackSubstIndexRAII SubstIndex(getSema(), I);
20052005
if (!TransformFunctionTypeParam(OldParm, /*indexAdjustment=*/0,
20062006
/*NumExpansions=*/OrigNumExpansions,
20072007
/*ExpectParameterPack=*/false))

clang/test/SemaCXX/overload-resolution-deferred-templates.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void f(int);
173173
void g(int n) { f(n); } // OK
174174
void h(short n) { f(n); }
175175
// expected-error@#GH62096-err {{static assertion failed due to requirement 'sizeof(short) == 0'}} \
176-
// expected-note@-1{{in instantiation of function template specialization}} \
176+
// expected-note@-1{{while substituting deduced template arguments}} \
177177
// expected-note@-1{{while checking constraint satisfaction for template}}
178178
// expected-note@#GH62096-note1{{in instantiation}}
179179
// expected-note@#GH62096-note1{{while substituting template arguments into constraint expression here}}

clang/test/SemaTemplate/deduction-guide.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -std=c++2a -verify -ast-dump -ast-dump-decl-types -ast-dump-filter "deduction guide" %s | FileCheck %s --strict-whitespace -dump-input=always
1+
// RUN: %clang_cc1 -std=c++2a -verify -ast-dump -ast-dump-decl-types -ast-dump-filter "deduction guide" %s | FileCheck %s --strict-whitespace
22

33
template<auto ...> struct X {};
44
template<template<typename X, X> typename> struct Y {};
@@ -234,7 +234,7 @@ F s(0);
234234
// CHECK: | `-CXXBoolLiteralExpr {{.*}} 'bool' false
235235
// CHECK: |-CXXDeductionGuideDecl {{.*}} implicit <deduction guide for F> 'auto (U) -> F<value-parameter-0-0>'
236236
// CHECK: | `-ParmVarDecl {{.*}} 'U'
237-
// CHECK: `-CXXDeductionGuideDecl {{.*}} implicit <deduction guide for F> 'auto (int) -> F<>'
237+
// CHECK: `-CXXDeductionGuideDecl {{.*}} implicit used <deduction guide for F> 'auto (int) -> F<>'
238238
// CHECK: |-TemplateArgument integral ''x''
239239
// CHECK: |-TemplateArgument type 'int'
240240
// CHECK: | `-BuiltinType {{.*}} 'int'

0 commit comments

Comments
 (0)