@@ -1065,7 +1065,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
1065
1065
if (getLangOpts ().CPlusPlus ) {
1066
1066
// Avoid the unnecessary parse-time lookup in the common case
1067
1067
// where the syntax forbids a type.
1068
- const Token & Next = NextToken ();
1068
+ Token Next = NextToken ();
1069
1069
1070
1070
if (Next.is (tok::ellipsis) && Tok.is (tok::identifier) &&
1071
1071
GetLookAheadToken (2 ).is (tok::l_square)) {
@@ -1081,9 +1081,8 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
1081
1081
// If this identifier was reverted from a token ID, and the next token
1082
1082
// is a parenthesis, this is likely to be a use of a type trait. Check
1083
1083
// those tokens.
1084
- if (Next.is (tok::l_paren) &&
1085
- Tok.is (tok::identifier) &&
1086
- Tok.getIdentifierInfo ()->hasRevertedTokenIDToIdentifier ()) {
1084
+ else if (Next.is (tok::l_paren) && Tok.is (tok::identifier) &&
1085
+ Tok.getIdentifierInfo ()->hasRevertedTokenIDToIdentifier ()) {
1087
1086
IdentifierInfo *II = Tok.getIdentifierInfo ();
1088
1087
// Build up the mapping of revertible type traits, for future use.
1089
1088
if (RevertibleTypeTraits.empty ()) {
@@ -1170,9 +1169,9 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
1170
1169
}
1171
1170
}
1172
1171
1173
- if ((!ColonIsSacred && Next.is (tok::colon)) ||
1174
- Next.isOneOf (tok::coloncolon, tok::less, tok::l_paren,
1175
- tok::l_brace)) {
1172
+ else if ((!ColonIsSacred && Next.is (tok::colon)) ||
1173
+ Next.isOneOf (tok::coloncolon, tok::less, tok::l_paren,
1174
+ tok::l_brace)) {
1176
1175
// If TryAnnotateTypeOrScopeToken annotates the token, tail recurse.
1177
1176
if (TryAnnotateTypeOrScopeToken ())
1178
1177
return ExprError ();
0 commit comments