| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
| 2 | |
| 3 | @class SUPER, Y; // expected-note 2 {{forward declaration of class here}} |
| 4 | |
| 5 | @interface INTF :SUPER // expected-error {{attempting to use the forward class 'SUPER' as superclass of 'INTF'}} |
| 6 | @end |
| 7 | |
| 8 | @interface SUPER @end |
| 9 | |
| 10 | @interface INTF1 : SUPER // expected-note {{previous definition is here}} |
| 11 | @end |
| 12 | |
| 13 | @interface INTF2 : INTF1 |
| 14 | @end |
| 15 | |
| 16 | @interface INTF3 : Y // expected-error {{attempting to use the forward class 'Y' as superclass of 'INTF3'}} \ |
| 17 | // expected-note{{'INTF3' declared here}} |
| 18 | @end |
| 19 | |
| 20 | @interface INTF1 // expected-error {{duplicate interface definition for class 'INTF1'}} |
| 21 | @end |
| 22 | |
| 23 | @implementation SUPER |
| 24 | - (void)dealloc { |
| 25 | [super dealloc]; // expected-error {{'SUPER' cannot use 'super' because it is a root class}} |
| 26 | } |
| 27 | @end |
| 28 | |
| 29 | @interface RecursiveClass : RecursiveClass // expected-error {{trying to recursively use 'RecursiveClass' as superclass of 'RecursiveClass'}} |
| 30 | @end |
| 31 | |
| 32 | @implementation RecursiveClass |
| 33 | @end |
| 34 | |
| 35 | @implementation iNTF3 // expected-warning{{cannot find interface declaration for 'iNTF3'; did you mean 'INTF3'?}} |
| 36 | @end |
| 37 | |