@@ -1961,11 +1961,11 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
19611961 MaybeParseCXX11Attributes (Attributes);
19621962
19631963 const PrintingPolicy &Policy = Actions.getASTContext ().getPrintingPolicy ();
1964- Sema:: TagUseKind TUK;
1964+ TagUseKind TUK;
19651965 if (isDefiningTypeSpecifierContext (DSC, getLangOpts ().CPlusPlus ) ==
19661966 AllowDefiningTypeSpec::No ||
19671967 (getLangOpts ().OpenMP && OpenMPDirectiveParsing))
1968- TUK = Sema::TUK_Reference ;
1968+ TUK = TagUseKind::Reference ;
19691969 else if (Tok.is (tok::l_brace) ||
19701970 (DSC != DeclSpecContext::DSC_association &&
19711971 getLangOpts ().CPlusPlus && Tok.is (tok::colon)) ||
@@ -1980,10 +1980,10 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
19801980 // Skip everything up to the semicolon, so that this looks like a proper
19811981 // friend class (or template thereof) declaration.
19821982 SkipUntil (tok::semi, StopBeforeMatch);
1983- TUK = Sema::TUK_Friend ;
1983+ TUK = TagUseKind::Friend ;
19841984 } else {
19851985 // Okay, this is a class definition.
1986- TUK = Sema::TUK_Definition ;
1986+ TUK = TagUseKind::Definition ;
19871987 }
19881988 } else if (isClassCompatibleKeyword () &&
19891989 (NextToken ().is (tok::l_square) ||
@@ -2024,15 +2024,15 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
20242024 }
20252025
20262026 if (Tok.isOneOf (tok::l_brace, tok::colon))
2027- TUK = Sema::TUK_Definition ;
2027+ TUK = TagUseKind::Definition ;
20282028 else
2029- TUK = Sema::TUK_Reference ;
2029+ TUK = TagUseKind::Reference ;
20302030
20312031 PA.Revert ();
20322032 } else if (!isTypeSpecifier (DSC) &&
20332033 (Tok.is (tok::semi) ||
20342034 (Tok.isAtStartOfLine () && !isValidAfterTypeSpecifier (false )))) {
2035- TUK = DS.isFriendSpecified () ? Sema::TUK_Friend : Sema::TUK_Declaration ;
2035+ TUK = DS.isFriendSpecified () ? TagUseKind::Friend : TagUseKind::Declaration ;
20362036 if (Tok.isNot (tok::semi)) {
20372037 const PrintingPolicy &PPol = Actions.getASTContext ().getPrintingPolicy ();
20382038 // A semicolon was missing after this declaration. Diagnose and recover.
@@ -2042,11 +2042,11 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
20422042 Tok.setKind (tok::semi);
20432043 }
20442044 } else
2045- TUK = Sema::TUK_Reference ;
2045+ TUK = TagUseKind::Reference ;
20462046
20472047 // Forbid misplaced attributes. In cases of a reference, we pass attributes
20482048 // to caller to handle.
2049- if (TUK != Sema::TUK_Reference ) {
2049+ if (TUK != TagUseKind::Reference ) {
20502050 // If this is not a reference, then the only possible
20512051 // valid place for C++11 attributes to appear here
20522052 // is between class-key and class-name. If there are
@@ -2072,7 +2072,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
20722072
20732073 if (!Name && !TemplateId &&
20742074 (DS.getTypeSpecType () == DeclSpec::TST_error ||
2075- TUK != Sema::TUK_Definition )) {
2075+ TUK != TagUseKind::Definition )) {
20762076 if (DS.getTypeSpecType () != DeclSpec::TST_error) {
20772077 // We have a declaration or reference to an anonymous class.
20782078 Diag (StartLoc, diag::err_anon_type_definition)
@@ -2082,7 +2082,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
20822082 // If we are parsing a definition and stop at a base-clause, continue on
20832083 // until the semicolon. Continuing from the comma will just trick us into
20842084 // thinking we are seeing a variable declaration.
2085- if (TUK == Sema::TUK_Definition && Tok.is (tok::colon))
2085+ if (TUK == TagUseKind::Definition && Tok.is (tok::colon))
20862086 SkipUntil (tok::semi, StopBeforeMatch);
20872087 else
20882088 SkipUntil (tok::comma, StopAtSemi);
@@ -2103,7 +2103,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
21032103 if (TemplateId->isInvalid ()) {
21042104 // Can't build the declaration.
21052105 } else if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation &&
2106- TUK == Sema::TUK_Declaration ) {
2106+ TUK == TagUseKind::Declaration ) {
21072107 // This is an explicit instantiation of a class template.
21082108 ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
21092109 diag::err_keyword_not_allowed,
@@ -2119,8 +2119,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
21192119 // they have template headers, in which case they're ill-formed
21202120 // (FIXME: "template <class T> friend class A<T>::B<int>;").
21212121 // We diagnose this error in ActOnClassTemplateSpecialization.
2122- } else if (TUK == Sema::TUK_Reference ||
2123- (TUK == Sema::TUK_Friend &&
2122+ } else if (TUK == TagUseKind::Reference ||
2123+ (TUK == TagUseKind::Friend &&
21242124 TemplateInfo.Kind == ParsedTemplateInfo::NonTemplate)) {
21252125 ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
21262126 diag::err_keyword_not_allowed,
@@ -2145,10 +2145,10 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
21452145 // It this is friend declaration however, since it cannot have a
21462146 // template header, it is most likely that the user meant to
21472147 // remove the 'template' keyword.
2148- assert ((TUK == Sema::TUK_Definition || TUK == Sema::TUK_Friend ) &&
2148+ assert ((TUK == TagUseKind::Definition || TUK == TagUseKind::Friend ) &&
21492149 " Expected a definition here" );
21502150
2151- if (TUK == Sema::TUK_Friend ) {
2151+ if (TUK == TagUseKind::Friend ) {
21522152 Diag (DS.getFriendSpecLoc (), diag::err_friend_explicit_instantiation);
21532153 TemplateParams = nullptr ;
21542154 } else {
@@ -2179,7 +2179,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
21792179 &SkipBody);
21802180 }
21812181 } else if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation &&
2182- TUK == Sema::TUK_Declaration ) {
2182+ TUK == TagUseKind::Declaration ) {
21832183 // Explicit instantiation of a member of a class template
21842184 // specialization, e.g.,
21852185 //
@@ -2190,7 +2190,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
21902190 TagOrTempResult = Actions.ActOnExplicitInstantiation (
21912191 getCurScope (), TemplateInfo.ExternLoc , TemplateInfo.TemplateLoc ,
21922192 TagType, StartLoc, SS, Name, NameLoc, attrs);
2193- } else if (TUK == Sema::TUK_Friend &&
2193+ } else if (TUK == TagUseKind::Friend &&
21942194 TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) {
21952195 ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
21962196 diag::err_keyword_not_allowed,
@@ -2202,12 +2202,12 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
22022202 MultiTemplateParamsArg (TemplateParams ? &(*TemplateParams)[0 ] : nullptr ,
22032203 TemplateParams ? TemplateParams->size () : 0 ));
22042204 } else {
2205- if (TUK != Sema::TUK_Declaration && TUK != Sema::TUK_Definition )
2205+ if (TUK != TagUseKind::Declaration && TUK != TagUseKind::Definition )
22062206 ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
22072207 diag::err_keyword_not_allowed,
22082208 /* DiagnoseEmptyAttrs=*/ true );
22092209
2210- if (TUK == Sema::TUK_Definition &&
2210+ if (TUK == TagUseKind::Definition &&
22112211 TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation) {
22122212 // If the declarator-id is not a template-id, issue a diagnostic and
22132213 // recover by ignoring the 'template' keyword.
@@ -2222,7 +2222,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
22222222 // reference. For example, we don't need the template parameters here:
22232223 // template <class T> class A *makeA(T t);
22242224 MultiTemplateParamsArg TParams;
2225- if (TUK != Sema::TUK_Reference && TemplateParams)
2225+ if (TUK != TagUseKind::Reference && TemplateParams)
22262226 TParams =
22272227 MultiTemplateParamsArg (&(*TemplateParams)[0 ], TemplateParams->size ());
22282228
@@ -2241,7 +2241,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
22412241 // If ActOnTag said the type was dependent, try again with the
22422242 // less common call.
22432243 if (IsDependent) {
2244- assert (TUK == Sema::TUK_Reference || TUK == Sema::TUK_Friend );
2244+ assert (TUK == TagUseKind::Reference || TUK == TagUseKind::Friend );
22452245 TypeResult = Actions.ActOnDependentTag (getCurScope (), TagType, TUK, SS,
22462246 Name, StartLoc, NameLoc);
22472247 }
@@ -2252,13 +2252,13 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
22522252 // just merge them into the current pool.
22532253 if (shouldDelayDiagsInTag) {
22542254 diagsFromTag.done ();
2255- if (TUK == Sema::TUK_Reference &&
2255+ if (TUK == TagUseKind::Reference &&
22562256 TemplateInfo.Kind == ParsedTemplateInfo::Template)
22572257 diagsFromTag.redelay ();
22582258 }
22592259
22602260 // If there is a body, parse it and inform the actions module.
2261- if (TUK == Sema::TUK_Definition ) {
2261+ if (TUK == TagUseKind::Definition ) {
22622262 assert (Tok.is (tok::l_brace) ||
22632263 (getLangOpts ().CPlusPlus && Tok.is (tok::colon)) ||
22642264 isClassCompatibleKeyword ());
@@ -2316,7 +2316,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
23162316 //
23172317 // After a type-specifier, we don't expect a semicolon. This only happens in
23182318 // C, since definitions are not permitted in this context in C++.
2319- if (TUK == Sema::TUK_Definition &&
2319+ if (TUK == TagUseKind::Definition &&
23202320 (getLangOpts ().CPlusPlus || !isTypeSpecifier (DSC)) &&
23212321 (TemplateInfo.Kind || !isValidAfterTypeSpecifier (false ))) {
23222322 if (Tok.isNot (tok::semi)) {
0 commit comments