summaryrefslogtreecommitdiff
path: root/clang/test/SemaObjC/block-as-object.m
blob: a85b6067571eee6039fcc7d8b2692ef609b67f3c (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks

@interface Whatever
- copy;
@end

typedef long (^MyBlock)(id obj1, id obj2);

void foo(MyBlock b) {
    id bar = [b copy];
}

void foo2(id b) {
}

void foo3(void (^block)(void)) {
    foo2(block);
    id x;
    foo(x);
}