aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-12 05:38:43 +0000
committerChris Lattner <sabre@nondot.org>2010-04-12 05:38:43 +0000
commit15faee19fdb9017dd6d08a690427b18c3b062c2d (patch)
treef9d51a91ac5ea9a4766e23ffc776b0cb08acb3d6 /lib/Parse/ParseObjc.cpp
parent69c05d504619f9ab2c860017eee4fd483b886698 (diff)
Have the parser decide whether a message to super is a variable or
type, instead of having sema do it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 6e31f0f63c..42076a244e 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1626,7 +1626,8 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDefinition() {
SourceLocation BraceLoc = Tok.getLocation();
// Enter a scope for the method body.
- ParseScope BodyScope(this, Scope::FnScope|Scope::DeclScope);
+ ParseScope BodyScope(this,
+ Scope::ObjCMethodScope|Scope::FnScope|Scope::DeclScope);
// Tell the actions module that we have entered a method definition with the
// specified Declarator for the method.
@@ -1723,7 +1724,8 @@ Parser::OwningExprResult Parser::ParseObjCMessageExpression() {
// If this is '[' 'super', then this is a magic superclass message.
// We parse '[' 'super' '.' 'foo' as an expression?
// FIXME: Not in ParseInit.cpp?
- if ((II == Ident_super && GetLookAheadToken(1).isNot(tok::period)) ||
+ if ((II == Ident_super && GetLookAheadToken(1).isNot(tok::period) &&
+ CurScope->isInObjcMethodScope()) ||
// Check to see if this is a typename. If so, it is a class message.
Actions.getTypeName(*II, Tok.getLocation(), CurScope)) {
SourceLocation NameLoc = ConsumeToken();