summaryrefslogtreecommitdiffstats
path: root/clang/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
commitc2ebb03297ed6597a6b05ff62a6f6461529d8e06 (patch)
treee24e29bf8af7952b994947b342e63e62e6667571 /clang/lib/Parse/ParseObjc.cpp
parent7ff88f8b0036a3707418b9b512003a1ccab1a160 (diff)
downloadbcm5719-llvm-c2ebb03297ed6597a6b05ff62a6f6461529d8e06.tar.gz
bcm5719-llvm-c2ebb03297ed6597a6b05ff62a6f6461529d8e06.zip
Have the parser decide whether a message to super is a variable or
type, instead of having sema do it. llvm-svn: 101016
Diffstat (limited to 'clang/lib/Parse/ParseObjc.cpp')
-rw-r--r--clang/lib/Parse/ParseObjc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index 6e31f0f63c3..42076a244ea 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud