[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaObjC / block-as-object.m
blob945d6f68d6eac2c59759b4d051ccfe61ef04edc7
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
2 // expected-no-diagnostics
4 @interface Whatever
5 - copy;
6 @end
8 typedef long (^MyBlock)(id obj1, id obj2);
10 void foo(MyBlock b) {
11     id bar = [b copy];
14 void foo2(id b) {
17 void foo3(void (^block)(void)) {
18     foo2(block);
19     id x;
20     foo(x);