3232#include " clang/Sema/SemaDiagnostic.h"
3333#include " clang/Sema/SemaObjC.h"
3434#include " clang/Sema/SemaOpenMP.h"
35+ #include " llvm/ADT/STLForwardCompat.h"
3536#include " llvm/ADT/SmallSet.h"
3637#include " llvm/ADT/SmallString.h"
3738#include " llvm/ADT/StringSwitch.h"
@@ -2335,8 +2336,8 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
23352336 D.setTemplateParameterLists (*TemplateInfo.TemplateParams );
23362337
23372338 bool IsTemplateSpecOrInst =
2338- (TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitInstantiation ||
2339- TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitSpecialization);
2339+ (TemplateInfo.Kind == ParsedTemplateKind ::ExplicitInstantiation ||
2340+ TemplateInfo.Kind == ParsedTemplateKind ::ExplicitSpecialization);
23402341 SuppressAccessChecks SAC (*this , IsTemplateSpecOrInst);
23412342
23422343 ParseDeclarator (D);
@@ -2427,7 +2428,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
24272428 }
24282429 Decl *TheDecl = nullptr ;
24292430
2430- if (TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitInstantiation) {
2431+ if (TemplateInfo.Kind == ParsedTemplateKind ::ExplicitInstantiation) {
24312432 if (D.getName ().getKind () != UnqualifiedIdKind::IK_TemplateId) {
24322433 // If the declarator-id is not a template-id, issue a diagnostic
24332434 // and recover by ignoring the 'template' keyword.
@@ -2574,10 +2575,10 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
25742575 // In a template-declaration, explicit specialization, or explicit
25752576 // instantiation the init-declarator-list in the declaration shall
25762577 // contain at most one declarator.
2577- if (TemplateInfo.Kind != ParsedTemplateInfo ::NonTemplate &&
2578+ if (TemplateInfo.Kind != ParsedTemplateKind ::NonTemplate &&
25782579 D.isFirstDeclarator ()) {
25792580 Diag (CommaLoc, diag::err_multiple_template_declarators)
2580- << TemplateInfo.Kind ;
2581+ << llvm::to_underlying ( TemplateInfo.Kind ) ;
25812582 }
25822583
25832584 // Parse the next declarator.
@@ -2740,12 +2741,12 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
27402741 Decl *ThisDecl = nullptr ;
27412742 Decl *OuterDecl = nullptr ;
27422743 switch (TemplateInfo.Kind ) {
2743- case ParsedTemplateInfo ::NonTemplate:
2744+ case ParsedTemplateKind ::NonTemplate:
27442745 ThisDecl = Actions.ActOnDeclarator (getCurScope (), D);
27452746 break ;
27462747
2747- case ParsedTemplateInfo ::Template:
2748- case ParsedTemplateInfo ::ExplicitSpecialization: {
2748+ case ParsedTemplateKind ::Template:
2749+ case ParsedTemplateKind ::ExplicitSpecialization: {
27492750 ThisDecl = Actions.ActOnTemplateDeclarator (getCurScope (),
27502751 *TemplateInfo.TemplateParams ,
27512752 D);
@@ -2757,7 +2758,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
27572758 }
27582759 break ;
27592760 }
2760- case ParsedTemplateInfo ::ExplicitInstantiation: {
2761+ case ParsedTemplateKind ::ExplicitInstantiation: {
27612762 if (Tok.is (tok::semi)) {
27622763 DeclResult ThisRes = Actions.ActOnExplicitInstantiation (
27632764 getCurScope (), TemplateInfo.ExternLoc , TemplateInfo.TemplateLoc , D);
@@ -3711,8 +3712,8 @@ void Parser::ParseDeclarationSpecifiers(
37113712 // Turn off usual access checking for template specializations and
37123713 // instantiations.
37133714 bool IsTemplateSpecOrInst =
3714- (TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitInstantiation ||
3715- TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitSpecialization);
3715+ (TemplateInfo.Kind == ParsedTemplateKind ::ExplicitInstantiation ||
3716+ TemplateInfo.Kind == ParsedTemplateKind ::ExplicitSpecialization);
37163717
37173718 switch (Tok.getKind ()) {
37183719 default :
@@ -3817,7 +3818,7 @@ void Parser::ParseDeclarationSpecifiers(
38173818 }
38183819
38193820 // Class context can appear inside a function/block, so prioritise that.
3820- if (TemplateInfo.Kind != ParsedTemplateInfo ::NonTemplate)
3821+ if (TemplateInfo.Kind != ParsedTemplateKind ::NonTemplate)
38213822 CCC = DSContext == DeclSpecContext::DSC_class
38223823 ? SemaCodeCompletion::PCC_MemberTemplate
38233824 : SemaCodeCompletion::PCC_Template;
@@ -5369,8 +5370,8 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
53695370 // we don't suppress if this turns out to be an elaborated type
53705371 // specifier.
53715372 bool shouldDelayDiagsInTag =
5372- (TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitInstantiation ||
5373- TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitSpecialization);
5373+ (TemplateInfo.Kind == ParsedTemplateKind ::ExplicitInstantiation ||
5374+ TemplateInfo.Kind == ParsedTemplateKind ::ExplicitSpecialization);
53745375 SuppressAccessChecks diagsFromTag (*this , shouldDelayDiagsInTag);
53755376
53765377 // Determine whether this declaration is permitted to have an enum-base.
@@ -5567,7 +5568,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
55675568 }
55685569
55695570 MultiTemplateParamsArg TParams;
5570- if (TemplateInfo.Kind != ParsedTemplateInfo ::NonTemplate &&
5571+ if (TemplateInfo.Kind != ParsedTemplateKind ::NonTemplate &&
55715572 TUK != TagUseKind::Reference) {
55725573 if (!getLangOpts ().CPlusPlus11 || !SS.isSet ()) {
55735574 // Skip the rest of this declarator, up until the comma or semicolon.
@@ -5576,7 +5577,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
55765577 return ;
55775578 }
55785579
5579- if (TemplateInfo.Kind == ParsedTemplateInfo ::ExplicitInstantiation) {
5580+ if (TemplateInfo.Kind == ParsedTemplateKind ::ExplicitInstantiation) {
55805581 // Enumerations can't be explicitly instantiated.
55815582 DS.SetTypeSpecError ();
55825583 Diag (StartLoc, diag::err_explicit_instantiation_enum);
0 commit comments