aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r--lib/Parse/ParseExprCXX.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp
index 19b521b264..006c79158a 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/lib/Parse/ParseExprCXX.cpp
@@ -198,17 +198,13 @@ Parser::ExprResult Parser::ParseCXXCasts() {
TypeTy *CastTy = ParseTypeName();
SourceLocation RAngleBracketLoc = Tok.getLocation();
- if (ExpectAndConsume(tok::greater, diag::err_expected_greater)) {
- Diag(LAngleBracketLoc, diag::err_matching, "<");
- return ExprResult(true);
- }
+ if (ExpectAndConsume(tok::greater, diag::err_expected_greater))
+ return Diag(LAngleBracketLoc, diag::err_matching) << "<";
SourceLocation LParenLoc = Tok.getLocation(), RParenLoc;
- if (Tok.isNot(tok::l_paren)) {
- Diag(Tok, diag::err_expected_lparen_after, CastName);
- return ExprResult(true);
- }
+ if (Tok.isNot(tok::l_paren))
+ return Diag(Tok, diag::err_expected_lparen_after) << CastName;
ExprResult Result = ParseSimpleParenExpression(RParenLoc);
@@ -515,7 +511,7 @@ bool Parser::ParseCXXTypeSpecifierSeq(DeclSpec &DS) {
// Parse one or more of the type specifiers.
if (!MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) {
- Diag(Tok.getLocation(), diag::err_operator_missing_type_specifier);
+ Diag(Tok, diag::err_operator_missing_type_specifier);
return true;
}
while (MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) ;