1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
2 | |
3 | int bar; |
4 | |
5 | @interface I |
6 | { |
7 | int _bar; |
8 | } |
9 | @property int PROP; |
10 | @property int PROP1; |
11 | @property int PROP2; |
12 | @property int PROP3; |
13 | @property int PROP4; |
14 | |
15 | @property int bar; |
16 | @property int bar1; |
17 | |
18 | @end |
19 | |
20 | @implementation I |
21 | - (int) Meth { return _PROP; } |
22 | |
23 | @dynamic PROP1; |
24 | - (int) Meth1 { return PROP1; } // expected-error {{use of undeclared identifier 'PROP1'}} |
25 | |
26 | - (int) Meth2 { return PROP2; } // expected-error {{use of undeclared identifier 'PROP2'}} |
27 | @dynamic PROP2; |
28 | |
29 | - (int) Meth3 { return PROP3; } // expected-error {{use of undeclared identifier 'PROP3'}} |
30 | @synthesize PROP3=IVAR; |
31 | |
32 | - (int) Meth4 { return PROP4; } |
33 | @synthesize PROP4=PROP4; // expected-note 4 {{'PROP4' declared here}} |
34 | |
35 | - (int) Meth5 { return bar; } |
36 | @synthesize bar = _bar; |
37 | |
38 | - (int) Meth6 { return _bar1; } |
39 | |
40 | @end |
41 | |
42 | @implementation I(CAT) |
43 | - (int) Meth { return PROP1; } // expected-error {{use of undeclared identifier 'PROP1'}} |
44 | @end |
45 | |
46 | @implementation I(r8251648) |
47 | - (int) Meth1: (int) bar { |
48 | return bar; |
49 | } |
50 | @end |
51 | |