| 1 | // RUN: %clang_cc1 -fsyntax-only -fdebugger-support -verify -Wno-objc-root-class %s |
| 2 | // RUN: %clang_cc1 -x objective-c++ -fdebugger-support -fsyntax-only -verify -Wno-objc-root-class %s |
| 3 | // expected-no-diagnostics |
| 4 | // rdar://10997647 |
| 5 | |
| 6 | @interface I |
| 7 | { |
| 8 | @private |
| 9 | int ivar; |
| 10 | } |
| 11 | @end |
| 12 | |
| 13 | @implementation I |
| 14 | - (int) meth { |
| 15 | return self->ivar; |
| 16 | } |
| 17 | int foo1(I* p) { |
| 18 | return p->ivar; |
| 19 | } |
| 20 | @end |
| 21 | |
| 22 | int foo(I* p) { |
| 23 | return p->ivar; |
| 24 | } |
| 25 | |
| 26 | @interface B |
| 27 | @end |
| 28 | |
| 29 | @implementation B |
| 30 | - (int) meth : (I*) arg { |
| 31 | return arg->ivar; |
| 32 | } |
| 33 | @end |
| 34 | |
| 35 | |
| 36 | @interface I1 { |
| 37 | int protected_ivar; |
| 38 | } |
| 39 | @property int PROP_INMAIN; |
| 40 | @end |
| 41 | |
| 42 | @interface I1() { |
| 43 | int private_ivar; |
| 44 | } |
| 45 | @property int PROP_INCLASSEXT; |
| 46 | @end |
| 47 | |
| 48 | @implementation I1 |
| 49 | @synthesize PROP_INMAIN, PROP_INCLASSEXT; |
| 50 | |
| 51 | - (int) Meth { |
| 52 | PROP_INMAIN = 1; |
| 53 | PROP_INCLASSEXT = 2; |
| 54 | protected_ivar = 1; // OK |
| 55 | return private_ivar; // OK |
| 56 | } |
| 57 | @end |
| 58 | |
| 59 | |
| 60 | @interface DER : I1 |
| 61 | @end |
| 62 | |
| 63 | @implementation DER |
| 64 | - (int) Meth { |
| 65 | protected_ivar = 1; // OK |
| 66 | PROP_INMAIN = 1; |
| 67 | PROP_INCLASSEXT = 2; |
| 68 | return private_ivar; |
| 69 | } |
| 70 | @end |
| 71 | |
| 72 | |