1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
---|---|
2 | // expected-no-diagnostics |
3 | |
4 | @interface MyParent { |
5 | int X; |
6 | } |
7 | @end |
8 | @implementation MyParent |
9 | @end |
10 | |
11 | @interface MyParent(AA) { |
12 | } |
13 | @end |
14 | @implementation MyParent (AA) |
15 | - (void) setX: (int)in {X = in - 2;} |
16 | - (int) X {return X;} |
17 | @end |
18 | |
19 | @interface MyClass : MyParent |
20 | @end |
21 | @implementation MyClass |
22 | @end |
23 | |
24 | int foo(MyClass *o) { |
25 | o.X = 2; |
26 | return o.X; |
27 | } |