37 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 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@end7 8@interface SUPER @end9 10@interface INTF1 : SUPER // expected-note {{previous definition is here}}11@end12 13@interface INTF2 : INTF114@end15 16@interface INTF3 : Y // expected-error {{attempting to use the forward class 'Y' as superclass of 'INTF3'}} \17 // expected-note{{'INTF3' declared here}}18@end19 20@interface INTF1 // expected-error {{duplicate interface definition for class 'INTF1'}}21@end22 23@implementation SUPER24- (void)dealloc {25 [super dealloc]; // expected-error {{'SUPER' cannot use 'super' because it is a root class}}26}27@end28 29@interface RecursiveClass : RecursiveClass // expected-error {{trying to recursively use 'RecursiveClass' as superclass of 'RecursiveClass'}}30@end31 32@implementation RecursiveClass33@end34 35@implementation iNTF3 // expected-warning{{cannot find interface declaration for 'iNTF3'; did you mean 'INTF3'?}}36@end37