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.
llvm-svn: 101021
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index ad42264..a29ea81 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -639,7 +639,9 @@
// 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)) {