@@ -1961,11 +1961,11 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
1961
1961
MaybeParseCXX11Attributes (Attributes);
1962
1962
1963
1963
const PrintingPolicy &Policy = Actions.getASTContext ().getPrintingPolicy ();
1964
- Sema:: TagUseKind TUK;
1964
+ TagUseKind TUK;
1965
1965
if (isDefiningTypeSpecifierContext (DSC, getLangOpts ().CPlusPlus ) ==
1966
1966
AllowDefiningTypeSpec::No ||
1967
1967
(getLangOpts ().OpenMP && OpenMPDirectiveParsing))
1968
- TUK = Sema::TUK_Reference ;
1968
+ TUK = TagUseKind::Reference ;
1969
1969
else if (Tok.is (tok::l_brace) ||
1970
1970
(DSC != DeclSpecContext::DSC_association &&
1971
1971
getLangOpts ().CPlusPlus && Tok.is (tok::colon)) ||
@@ -1980,10 +1980,10 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
1980
1980
// Skip everything up to the semicolon, so that this looks like a proper
1981
1981
// friend class (or template thereof) declaration.
1982
1982
SkipUntil (tok::semi, StopBeforeMatch);
1983
- TUK = Sema::TUK_Friend ;
1983
+ TUK = TagUseKind::Friend ;
1984
1984
} else {
1985
1985
// Okay, this is a class definition.
1986
- TUK = Sema::TUK_Definition ;
1986
+ TUK = TagUseKind::Definition ;
1987
1987
}
1988
1988
} else if (isClassCompatibleKeyword () &&
1989
1989
(NextToken ().is (tok::l_square) ||
@@ -2024,15 +2024,15 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2024
2024
}
2025
2025
2026
2026
if (Tok.isOneOf (tok::l_brace, tok::colon))
2027
- TUK = Sema::TUK_Definition ;
2027
+ TUK = TagUseKind::Definition ;
2028
2028
else
2029
- TUK = Sema::TUK_Reference ;
2029
+ TUK = TagUseKind::Reference ;
2030
2030
2031
2031
PA.Revert ();
2032
2032
} else if (!isTypeSpecifier (DSC) &&
2033
2033
(Tok.is (tok::semi) ||
2034
2034
(Tok.isAtStartOfLine () && !isValidAfterTypeSpecifier (false )))) {
2035
- TUK = DS.isFriendSpecified () ? Sema::TUK_Friend : Sema::TUK_Declaration ;
2035
+ TUK = DS.isFriendSpecified () ? TagUseKind::Friend : TagUseKind::Declaration ;
2036
2036
if (Tok.isNot (tok::semi)) {
2037
2037
const PrintingPolicy &PPol = Actions.getASTContext ().getPrintingPolicy ();
2038
2038
// A semicolon was missing after this declaration. Diagnose and recover.
@@ -2042,11 +2042,11 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2042
2042
Tok.setKind (tok::semi);
2043
2043
}
2044
2044
} else
2045
- TUK = Sema::TUK_Reference ;
2045
+ TUK = TagUseKind::Reference ;
2046
2046
2047
2047
// Forbid misplaced attributes. In cases of a reference, we pass attributes
2048
2048
// to caller to handle.
2049
- if (TUK != Sema::TUK_Reference ) {
2049
+ if (TUK != TagUseKind::Reference ) {
2050
2050
// If this is not a reference, then the only possible
2051
2051
// valid place for C++11 attributes to appear here
2052
2052
// is between class-key and class-name. If there are
@@ -2072,7 +2072,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2072
2072
2073
2073
if (!Name && !TemplateId &&
2074
2074
(DS.getTypeSpecType () == DeclSpec::TST_error ||
2075
- TUK != Sema::TUK_Definition )) {
2075
+ TUK != TagUseKind::Definition )) {
2076
2076
if (DS.getTypeSpecType () != DeclSpec::TST_error) {
2077
2077
// We have a declaration or reference to an anonymous class.
2078
2078
Diag (StartLoc, diag::err_anon_type_definition)
@@ -2082,7 +2082,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2082
2082
// If we are parsing a definition and stop at a base-clause, continue on
2083
2083
// until the semicolon. Continuing from the comma will just trick us into
2084
2084
// 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))
2086
2086
SkipUntil (tok::semi, StopBeforeMatch);
2087
2087
else
2088
2088
SkipUntil (tok::comma, StopAtSemi);
@@ -2103,7 +2103,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2103
2103
if (TemplateId->isInvalid ()) {
2104
2104
// Can't build the declaration.
2105
2105
} else if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation &&
2106
- TUK == Sema::TUK_Declaration ) {
2106
+ TUK == TagUseKind::Declaration ) {
2107
2107
// This is an explicit instantiation of a class template.
2108
2108
ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
2109
2109
diag::err_keyword_not_allowed,
@@ -2119,8 +2119,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2119
2119
// they have template headers, in which case they're ill-formed
2120
2120
// (FIXME: "template <class T> friend class A<T>::B<int>;").
2121
2121
// 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 &&
2124
2124
TemplateInfo.Kind == ParsedTemplateInfo::NonTemplate)) {
2125
2125
ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
2126
2126
diag::err_keyword_not_allowed,
@@ -2145,10 +2145,10 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2145
2145
// It this is friend declaration however, since it cannot have a
2146
2146
// template header, it is most likely that the user meant to
2147
2147
// remove the 'template' keyword.
2148
- assert ((TUK == Sema::TUK_Definition || TUK == Sema::TUK_Friend ) &&
2148
+ assert ((TUK == TagUseKind::Definition || TUK == TagUseKind::Friend ) &&
2149
2149
" Expected a definition here" );
2150
2150
2151
- if (TUK == Sema::TUK_Friend ) {
2151
+ if (TUK == TagUseKind::Friend ) {
2152
2152
Diag (DS.getFriendSpecLoc (), diag::err_friend_explicit_instantiation);
2153
2153
TemplateParams = nullptr ;
2154
2154
} else {
@@ -2179,7 +2179,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2179
2179
&SkipBody);
2180
2180
}
2181
2181
} else if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation &&
2182
- TUK == Sema::TUK_Declaration ) {
2182
+ TUK == TagUseKind::Declaration ) {
2183
2183
// Explicit instantiation of a member of a class template
2184
2184
// specialization, e.g.,
2185
2185
//
@@ -2190,7 +2190,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2190
2190
TagOrTempResult = Actions.ActOnExplicitInstantiation (
2191
2191
getCurScope (), TemplateInfo.ExternLoc , TemplateInfo.TemplateLoc ,
2192
2192
TagType, StartLoc, SS, Name, NameLoc, attrs);
2193
- } else if (TUK == Sema::TUK_Friend &&
2193
+ } else if (TUK == TagUseKind::Friend &&
2194
2194
TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) {
2195
2195
ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
2196
2196
diag::err_keyword_not_allowed,
@@ -2202,12 +2202,12 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2202
2202
MultiTemplateParamsArg (TemplateParams ? &(*TemplateParams)[0 ] : nullptr ,
2203
2203
TemplateParams ? TemplateParams->size () : 0 ));
2204
2204
} else {
2205
- if (TUK != Sema::TUK_Declaration && TUK != Sema::TUK_Definition )
2205
+ if (TUK != TagUseKind::Declaration && TUK != TagUseKind::Definition )
2206
2206
ProhibitCXX11Attributes (attrs, diag::err_attributes_not_allowed,
2207
2207
diag::err_keyword_not_allowed,
2208
2208
/* DiagnoseEmptyAttrs=*/ true );
2209
2209
2210
- if (TUK == Sema::TUK_Definition &&
2210
+ if (TUK == TagUseKind::Definition &&
2211
2211
TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation) {
2212
2212
// If the declarator-id is not a template-id, issue a diagnostic and
2213
2213
// recover by ignoring the 'template' keyword.
@@ -2222,7 +2222,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2222
2222
// reference. For example, we don't need the template parameters here:
2223
2223
// template <class T> class A *makeA(T t);
2224
2224
MultiTemplateParamsArg TParams;
2225
- if (TUK != Sema::TUK_Reference && TemplateParams)
2225
+ if (TUK != TagUseKind::Reference && TemplateParams)
2226
2226
TParams =
2227
2227
MultiTemplateParamsArg (&(*TemplateParams)[0 ], TemplateParams->size ());
2228
2228
@@ -2241,7 +2241,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2241
2241
// If ActOnTag said the type was dependent, try again with the
2242
2242
// less common call.
2243
2243
if (IsDependent) {
2244
- assert (TUK == Sema::TUK_Reference || TUK == Sema::TUK_Friend );
2244
+ assert (TUK == TagUseKind::Reference || TUK == TagUseKind::Friend );
2245
2245
TypeResult = Actions.ActOnDependentTag (getCurScope (), TagType, TUK, SS,
2246
2246
Name, StartLoc, NameLoc);
2247
2247
}
@@ -2252,13 +2252,13 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2252
2252
// just merge them into the current pool.
2253
2253
if (shouldDelayDiagsInTag) {
2254
2254
diagsFromTag.done ();
2255
- if (TUK == Sema::TUK_Reference &&
2255
+ if (TUK == TagUseKind::Reference &&
2256
2256
TemplateInfo.Kind == ParsedTemplateInfo::Template)
2257
2257
diagsFromTag.redelay ();
2258
2258
}
2259
2259
2260
2260
// If there is a body, parse it and inform the actions module.
2261
- if (TUK == Sema::TUK_Definition ) {
2261
+ if (TUK == TagUseKind::Definition ) {
2262
2262
assert (Tok.is (tok::l_brace) ||
2263
2263
(getLangOpts ().CPlusPlus && Tok.is (tok::colon)) ||
2264
2264
isClassCompatibleKeyword ());
@@ -2316,7 +2316,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
2316
2316
//
2317
2317
// After a type-specifier, we don't expect a semicolon. This only happens in
2318
2318
// C, since definitions are not permitted in this context in C++.
2319
- if (TUK == Sema::TUK_Definition &&
2319
+ if (TUK == TagUseKind::Definition &&
2320
2320
(getLangOpts ().CPlusPlus || !isTypeSpecifier (DSC)) &&
2321
2321
(TemplateInfo.Kind || !isValidAfterTypeSpecifier (false ))) {
2322
2322
if (Tok.isNot (tok::semi)) {
0 commit comments