aboutsummaryrefslogtreecommitdiff
path: root/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
commit8b9f187ab79e4077067f57660c75d6ac24066c7e (patch)
treeccc1cfa2f0991423e44555135cd5777dbe50928c /lib/Parse/ParseExpr.cpp
parent6275e0cac39b76204644154fd99a449f57c589d4 (diff)
tighten the check for cast of super to avoid rejecting valid code,
rdar://7853261 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 9ec5f1677f..e479c36792 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/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();