diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-04 22:28:21 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-04 22:28:21 +0000 | 
| commit | 8a38aa83daa7d81adb9aa09e4c590edf5f66cb56 (patch) | |
| tree | 6c6ce2e4e0bb75cdf5662588c8b1ad3f7c04aab1 /clang/lib/Parse | |
| parent | 109faf2b8b6f01b941fd257a4850e57c7c9a0a2e (diff) | |
| download | bcm5719-llvm-8a38aa83daa7d81adb9aa09e4c590edf5f66cb56.tar.gz bcm5719-llvm-8a38aa83daa7d81adb9aa09e4c590edf5f66cb56.zip  | |
simplify control flow by removing a goto.
llvm-svn: 61641
Diffstat (limited to 'clang/lib/Parse')
| -rw-r--r-- | clang/lib/Parse/ParseExpr.cpp | 15 | 
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index f719b8914f5..f05119d7973 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -602,11 +602,13 @@ Parser::OwningExprResult Parser::ParseCastExpression(bool isUnaryExpression) {    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 @@ Parser::OwningExprResult Parser::ParseCastExpression(bool isUnaryExpression) {      // 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();    }  | 

