simplify control flow by removing a goto.
llvm-svn: 61641
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index f719b89..f05119d 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -602,11 +602,13 @@
case tok::kw_float:
case tok::kw_double:
case tok::kw_void:
- case tok::kw_typeof: {
- if (!getLang().CPlusPlus)
- goto UnhandledToken;
- case tok::annot_qualtypename:
- assert(getLang().CPlusPlus && "Expected C++");
+ case tok::kw_typeof:
+ case tok::annot_qualtypename: {
+ if (!getLang().CPlusPlus) {
+ Diag(Tok, diag::err_expected_expression);
+ return ExprError();
+ }
+
// postfix-expression: simple-type-specifier '(' expression-list[opt] ')'
//
DeclSpec DS;
@@ -657,9 +659,8 @@
// These can be followed by postfix-expr pieces.
if (getLang().ObjC1)
return ParsePostfixExpressionSuffix(ParseObjCMessageExpression());
- // FALL THROUGH.
+ // FALL THROUGH.
default:
- UnhandledToken:
Diag(Tok, diag::err_expected_expression);
return ExprError();
}