aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-12 06:20:33 +0000
committerChris Lattner <sabre@nondot.org>2010-04-12 06:20:33 +0000
commit236beabc78c2998dbd0e45d952a3ca16f23134c7 (patch)
treefe506bcc7ce05718175daf6486f1238c9c66c849 /lib/Parse/ParseExpr.cpp
parent966c78b79004061c1f64feff96818b9f1d68ea58 (diff)
fix a rejects-valid testcase involving super that I dreamt up.
This also fixes cases where super is used in a block in a method which isn't valid. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index ad422642e4..a29ea81f76 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -639,7 +639,9 @@ Parser::OwningExprResult Parser::ParseCastExpression(bool isUnaryExpression,
// Support 'Class.property' and 'super.property' notation.
if (getLang().ObjC1 && Tok.is(tok::period) &&
- (Actions.getTypeName(II, ILoc, CurScope) || II.isStr("super"))) {
+ (Actions.getTypeName(II, ILoc, CurScope) ||
+ // Allow the base to be 'super' if in an objc-method.
+ (II.isStr("super") && CurScope->isInObjcMethodScope()))) {
SourceLocation DotLoc = ConsumeToken();
if (Tok.isNot(tok::identifier)) {