summaryrefslogtreecommitdiff
path: root/test/SemaObjC/arc-unsafe_unretained.m
blob: 99e870f643a84e80f435895a456bb7fb88f79a75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks %s
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -fobjc-arc %s
// expected-no-diagnostics

struct X {
  __unsafe_unretained id object;
  int (^ __unsafe_unretained block)(int, int);
};

void f(struct X x) {
  x.object = 0;
  x.block = ^(int x, int y) { return x + y; };
}