diff options
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 13b32acd5b299..cd7618f665367 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -777,7 +777,7 @@ Parser::OwningExprResult Parser::ParseCastExpression(bool isUnaryExpression, case tok::annot_cxxscope: // [C++] id-expression: qualified-id case tok::kw_operator: // [C++] id-expression: operator/conversion-function-id - // template-id + case tok::annot_template_id: // [C++] template-id Res = ParseCXXIdExpression(isAddressOfOperand); return ParsePostfixExpressionSuffix(move(Res)); @@ -1172,17 +1172,18 @@ Parser::OwningExprResult Parser::ParseBuiltinPrimaryExpression() { Comps.back().LocEnd = MatchRHSPunctuation(tok::r_square, Comps.back().LocStart); - } else if (Tok.is(tok::r_paren)) { - if (Ty.isInvalid()) + } else { + if (Tok.isNot(tok::r_paren)) { + MatchRHSPunctuation(tok::r_paren, LParenLoc); + Res = ExprError(); + } else if (Ty.isInvalid()) { Res = ExprError(); - else + } else { Res = Actions.ActOnBuiltinOffsetOf(CurScope, StartLoc, TypeLoc, Ty.get(), &Comps[0], Comps.size(), ConsumeParen()); + } break; - } else { - // Error occurred. - return ExprError(); } } break; |