mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
Also 'self' in blocks need be handled specially.
// rdar://9181463 llvm-svn: 128410
This commit is contained in:
parent
87c19f61d4
commit
d0d31bf263
@ -325,7 +325,10 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
|
||||
|
||||
bool Sema::isSelfExpr(Expr *RExpr) {
|
||||
// 'self' is objc 'self' in an objc method only.
|
||||
if (!isa<ObjCMethodDecl>(CurContext))
|
||||
DeclContext *DC = CurContext;
|
||||
while (isa<BlockDecl>(DC))
|
||||
DC = DC->getParent();
|
||||
if (DC && !isa<ObjCMethodDecl>(DC))
|
||||
return false;
|
||||
if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(RExpr))
|
||||
if (ICE->getCastKind() == CK_LValueToRValue)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
|
||||
// rdar://9181463
|
||||
|
||||
typedef struct objc_class *Class;
|
||||
@ -14,6 +14,9 @@ typedef struct objc_object {
|
||||
|
||||
void foo(Class self) {
|
||||
[self alloc];
|
||||
(^() {
|
||||
[self alloc];
|
||||
})();
|
||||
}
|
||||
|
||||
void bar(Class self) {
|
||||
|
Loading…
Reference in New Issue
Block a user