summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-12 17:09:27 +0000
committerChris Lattner <sabre@nondot.org>2010-04-12 17:09:27 +0000
commit5ff40fc7ab7ab9fcb42ad1dd66e2a43479177119 (patch)
tree2ce15ae4d2c14ed2413c0f463d2825e29dc8a362 /clang/lib/Parse/ParseExpr.cpp
parentb93b606759c41aff4e6c8ce8c4ccc2a681880f4f (diff)
downloadbcm5719-llvm-5ff40fc7ab7ab9fcb42ad1dd66e2a43479177119.tar.gz
bcm5719-llvm-5ff40fc7ab7ab9fcb42ad1dd66e2a43479177119.zip
tighten the check for cast of super to avoid rejecting valid code,
rdar://7853261 llvm-svn: 101048
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 9ec5f1677fd..e479c367925 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -1444,7 +1444,8 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
// Reject the cast of super idiom in ObjC.
if (Tok.is(tok::identifier) && getLang().ObjC1 &&
Tok.getIdentifierInfo() == Ident_super &&
- CurScope->isInObjcMethodScope()) {
+ CurScope->isInObjcMethodScope() &&
+ GetLookAheadToken(1).isNot(tok::period)) {
Diag(Tok.getLocation(), diag::err_illegal_super_cast)
<< SourceRange(OpenLoc, RParenLoc);
return ExprError();
OpenPOWER on IntegriCloud