]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaObjC/self-in-function.m
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / SemaObjC / self-in-function.m
1 // RUN: %clang_cc1  -fsyntax-only -fblocks -verify %s
2 // expected-no-diagnostics
3 // rdar://9181463
4
5 typedef struct objc_class *Class;
6
7 typedef struct objc_object {
8     Class isa;
9 } *id;
10
11 @interface NSObject
12 + (id) alloc;
13 @end
14
15
16 void foo(Class self) {
17   [self alloc];
18   (^() {
19     [self alloc];
20    })();
21 }
22
23 void bar(Class self) {
24   Class y = self;
25   [y alloc];
26 }
27