summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-09 03:59:21 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-09 03:59:21 +0000
commit76b9027f352a83c13c98820724071c5e3bea6232 (patch)
tree7319685297e02f0aad25f181838fda329b6cb331 /clang/lib/Sema/SemaTemplate.cpp
parentac0456594b0815b5390f5c7f1d2f16de074222e6 (diff)
downloadbcm5719-llvm-76b9027f352a83c13c98820724071c5e3bea6232.tar.gz
bcm5719-llvm-76b9027f352a83c13c98820724071c5e3bea6232.zip
[c++20] Add support for explicit(bool), as described in P0892R2.
Patch by Tyker! Differential Revision: https://reviews.llvm.org/D60934 llvm-svn: 360311
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index c58c446e52c..4b6ae96de40 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -1156,7 +1156,7 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D,
if (DS.isVirtualSpecified())
EmitDiag(DS.getVirtualSpecLoc());
- if (DS.isExplicitSpecified())
+ if (DS.hasExplicitSpecifier())
EmitDiag(DS.getExplicitSpecLoc());
if (DS.isNoreturnSpecified())
@@ -1836,8 +1836,8 @@ struct ConvertConstructorToDeductionGuideTransform {
return nullptr;
TypeSourceInfo *NewTInfo = TLB.getTypeSourceInfo(SemaRef.Context, NewType);
- return buildDeductionGuide(TemplateParams, CD->isExplicit(), NewTInfo,
- CD->getBeginLoc(), CD->getLocation(),
+ return buildDeductionGuide(TemplateParams, CD->getExplicitSpecifier(),
+ NewTInfo, CD->getBeginLoc(), CD->getLocation(),
CD->getEndLoc());
}
@@ -1866,8 +1866,8 @@ struct ConvertConstructorToDeductionGuideTransform {
Params.push_back(NewParam);
}
- return buildDeductionGuide(Template->getTemplateParameters(), false, TSI,
- Loc, Loc, Loc);
+ return buildDeductionGuide(Template->getTemplateParameters(),
+ ExplicitSpecifier(), TSI, Loc, Loc, Loc);
}
private:
@@ -2017,7 +2017,7 @@ private:
}
NamedDecl *buildDeductionGuide(TemplateParameterList *TemplateParams,
- bool Explicit, TypeSourceInfo *TInfo,
+ ExplicitSpecifier ES, TypeSourceInfo *TInfo,
SourceLocation LocStart, SourceLocation Loc,
SourceLocation LocEnd) {
DeclarationNameInfo Name(DeductionGuideName, Loc);
@@ -2026,8 +2026,8 @@ private:
// Build the implicit deduction guide template.
auto *Guide =
- CXXDeductionGuideDecl::Create(SemaRef.Context, DC, LocStart, Explicit,
- Name, TInfo->getType(), TInfo, LocEnd);
+ CXXDeductionGuideDecl::Create(SemaRef.Context, DC, LocStart, ES, Name,
+ TInfo->getType(), TInfo, LocEnd);
Guide->setImplicit();
Guide->setParams(Params);
OpenPOWER on IntegriCloud