зеркало из https://github.com/microsoft/clang-1.git
Fix <rdar://problem/6251012> clang: Blocks are objects too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
a30730e5cd
Коммит
6c4088e5fc
|
@ -281,7 +281,8 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
|
|||
Context.getCanonicalType(RExpr->getType()).getUnqualifiedType();
|
||||
|
||||
// Handle messages to id.
|
||||
if (ReceiverCType == Context.getCanonicalType(Context.getObjCIdType())) {
|
||||
if (ReceiverCType == Context.getCanonicalType(Context.getObjCIdType()) ||
|
||||
ReceiverCType->getAsBlockPointerType()) {
|
||||
ObjCMethodDecl *Method = InstanceMethodPool[Sel].Method;
|
||||
if (!Method)
|
||||
Method = FactoryMethodPool[Sel].Method;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// RUN: clang %s -fsyntax-only -verify
|
||||
|
||||
@interface Whatever
|
||||
- copy;
|
||||
@end
|
||||
|
||||
typedef long (^MyBlock)(id obj1, id obj2);
|
||||
|
||||
void foo(MyBlock b) {
|
||||
id bar = [b copy];
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче