aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaTemplate.cpp2
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp4
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp5
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp9
-rw-r--r--lib/Sema/SemaType.cpp4
-rw-r--r--lib/Sema/TreeTransform.h5
6 files changed, 13 insertions, 16 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index c3e3149cf9..61fd826360 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -3036,7 +3036,7 @@ static Optional<unsigned> getExpandedPackSize(NamedDecl *Param) {
return TTP->getNumExpansionTemplateParameters();
}
- return Optional<unsigned>();
+ return None;
}
/// \brief Check that the given template argument list is well-formed
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index bbf2a98441..c8f03725b9 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -628,7 +628,7 @@ Optional<TemplateDeductionInfo *> Sema::isSFINAEContext() const {
case ActiveTemplateInstantiation::DefaultFunctionArgumentInstantiation:
case ActiveTemplateInstantiation::ExceptionSpecInstantiation:
// This is a template instantiation, so there is no SFINAE.
- return Optional<TemplateDeductionInfo *>();
+ return None;
case ActiveTemplateInstantiation::DefaultTemplateArgumentInstantiation:
case ActiveTemplateInstantiation::PriorTemplateArgumentSubstitution:
@@ -647,7 +647,7 @@ Optional<TemplateDeductionInfo *> Sema::isSFINAEContext() const {
}
}
- return Optional<TemplateDeductionInfo *>();
+ return None;
}
/// \brief Retrieve the depth and index of a parameter pack.
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index b971a04d61..1515a358ff 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1638,9 +1638,8 @@ Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) {
}
ParmVarDecl *TemplateDeclInstantiator::VisitParmVarDecl(ParmVarDecl *D) {
- return SemaRef.SubstParmVarDecl(D, TemplateArgs, /*indexAdjustment*/ 0,
- Optional<unsigned>(),
- /*ExpectParameterPack=*/false);
+ return SemaRef.SubstParmVarDecl(D, TemplateArgs, /*indexAdjustment*/ 0, None,
+ /*ExpectParameterPack=*/ false);
}
Decl *TemplateDeclInstantiator::VisitTemplateTypeParmDecl(
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
index 2cff7aa6b7..c0ad2be6d4 100644
--- a/lib/Sema/SemaTemplateVariadic.cpp
+++ b/lib/Sema/SemaTemplateVariadic.cpp
@@ -443,8 +443,7 @@ TypeResult Sema::ActOnPackExpansion(ParsedType Type,
if (!TSInfo)
return true;
- TypeSourceInfo *TSResult =
- CheckPackExpansion(TSInfo, EllipsisLoc, Optional<unsigned>());
+ TypeSourceInfo *TSResult = CheckPackExpansion(TSInfo, EllipsisLoc, None);
if (!TSResult)
return true;
@@ -490,7 +489,7 @@ QualType Sema::CheckPackExpansion(QualType Pattern, SourceRange PatternRange,
}
ExprResult Sema::ActOnPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc) {
- return CheckPackExpansion(Pattern, EllipsisLoc, Optional<unsigned>());
+ return CheckPackExpansion(Pattern, EllipsisLoc, None);
}
ExprResult Sema::CheckPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc,
@@ -662,7 +661,7 @@ Optional<unsigned> Sema::getNumArgumentsInExpansion(QualType T,
if (Instantiation->is<Decl*>())
// The pattern refers to an unexpanded pack. We're not ready to expand
// this pack yet.
- return Optional<unsigned>();
+ return None;
unsigned Size = Instantiation->get<DeclArgumentPack *>()->size();
assert((!Result || *Result == Size) && "inconsistent pack sizes");
@@ -676,7 +675,7 @@ Optional<unsigned> Sema::getNumArgumentsInExpansion(QualType T,
!TemplateArgs.hasTemplateArgument(Depth, Index))
// The pattern refers to an unknown template argument. We're not ready to
// expand this pack yet.
- return Optional<unsigned>();
+ return None;
// Determine the size of the argument pack.
unsigned Size = TemplateArgs(Depth, Index).pack_size();
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index d4d42cd0ab..209699f4b8 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -2889,7 +2889,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
<< T << D.getSourceRange();
D.setEllipsisLoc(SourceLocation());
} else {
- T = Context.getPackExpansionType(T, Optional<unsigned>());
+ T = Context.getPackExpansionType(T, None);
}
break;
@@ -2903,7 +2903,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
// parameter packs in the type of the non-type template parameter, then
// it expands those parameter packs.
if (T->containsUnexpandedParameterPack())
- T = Context.getPackExpansionType(T, Optional<unsigned>());
+ T = Context.getPackExpansionType(T, None);
else
S.Diag(D.getEllipsisLoc(),
LangOpts.CPlusPlus11
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 0832a24d79..438d06a8ef 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -4098,8 +4098,7 @@ bool TreeTransform<Derived>::
/*ExpectParameterPack=*/true);
} else {
NewParm = getDerived().TransformFunctionTypeParam(
- OldParm, indexAdjustment, Optional<unsigned>(),
- /*ExpectParameterPack=*/ false);
+ OldParm, indexAdjustment, None, /*ExpectParameterPack=*/ false);
}
if (!NewParm)
@@ -8565,7 +8564,7 @@ TreeTransform<Derived>::TransformObjCDictionaryLiteral(
ArgChanged = true;
ObjCDictionaryElement Element = {
- Key.get(), Value.get(), SourceLocation(), Optional<unsigned>()
+ Key.get(), Value.get(), SourceLocation(), None
};
Elements.push_back(Element);
}