diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-12 06:27:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-12 06:27:57 +0000 |
commit | 3ab8ca2894dc9f6bfaf1dfe39357d39ce02b504d (patch) | |
tree | 16800954cec0d1b3558c21563d6b4db7792e9fee /clang/lib | |
parent | 250283916dd1654d5f482b2ee9fd0af41bc5f1bf (diff) | |
download | bcm5719-llvm-3ab8ca2894dc9f6bfaf1dfe39357d39ce02b504d.tar.gz bcm5719-llvm-3ab8ca2894dc9f6bfaf1dfe39357d39ce02b504d.zip |
fix a rejects-valid bug that I introduced, pointed out
by David Chisnall
llvm-svn: 101024
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseExpr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index d1686a183e3..9ec5f1677fd 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1436,15 +1436,15 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, CastTy = Ty.get(); - if (stopIfCastExpr) { - // Note that this doesn't parse the subsequent cast-expression, it just - // returns the parsed type to the callee. + // Note that this doesn't parse the subsequent cast-expression, it just + // returns the parsed type to the callee. + if (stopIfCastExpr) return OwningExprResult(Actions); - } // Reject the cast of super idiom in ObjC. if (Tok.is(tok::identifier) && getLang().ObjC1 && - Tok.getIdentifierInfo() == Ident_super) { + Tok.getIdentifierInfo() == Ident_super && + CurScope->isInObjcMethodScope()) { Diag(Tok.getLocation(), diag::err_illegal_super_cast) << SourceRange(OpenLoc, RParenLoc); return ExprError(); |