diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-12 17:25:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-12 17:25:51 +0000 |
commit | a7a98c97e650545e69f4d868c95f0e3370971b0f (patch) | |
tree | 6fcb0aacef8fc546a28ea54613fc88f2838d3733 /lib/Sema/SemaExprObjC.cpp | |
parent | 8b9f187ab79e4077067f57660c75d6ac24066c7e (diff) |
fix PR6819
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index b933e72aa2..26d115667c 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -499,6 +499,7 @@ ActOnClassMessage(Scope *S, IdentifierInfo *receiverName, Selector Sel, Expr **ArgExprs = reinterpret_cast<Expr **>(Args); ObjCInterfaceDecl *ClassDecl = 0; + bool isSuper = false; // Special case a message to super, which can be either a class message or an // instance message, depending on what CurMethodDecl is. @@ -523,6 +524,7 @@ ActOnClassMessage(Scope *S, IdentifierInfo *receiverName, Selector Sel, // Otherwise, if this is a class method, try dispatching to our // superclass, which is in ClassDecl. + isSuper = true; } } @@ -583,6 +585,14 @@ ActOnClassMessage(Scope *S, IdentifierInfo *receiverName, Selector Sel, returnType = returnType.getNonReferenceType(); + // FIXME: need to do a better job handling 'super' usage within a class. For + // now, we simply pass the "super" identifier through (which isn't consistent + // with instance methods. + if (isSuper) + return new (Context) ObjCMessageExpr(Context, receiverName, receiverLoc, + Sel, returnType, Method, lbrac, rbrac, + ArgExprs, NumArgs); + // If we have the ObjCInterfaceDecl* for the class that is receiving the // message, use that to construct the ObjCMessageExpr. Otherwise pass on the // IdentifierInfo* for the class. |