2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2007-10-04 08:22:33 +08:00
|
|
|
|
2011-06-24 07:16:19 +08:00
|
|
|
@class SUPER, Y; // expected-note 2 {{forward class is declared here}}
|
2007-09-21 01:54:07 +08:00
|
|
|
|
2011-06-24 07:16:19 +08:00
|
|
|
@interface INTF :SUPER // expected-error {{attempting to use the forward class 'SUPER' as superclass of 'INTF'}}
|
2007-09-21 01:54:07 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface SUPER @end
|
|
|
|
|
2008-11-24 06:46:27 +08:00
|
|
|
@interface INTF1 : SUPER // expected-note {{previous definition is here}}
|
2007-09-21 01:54:07 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface INTF2 : INTF1
|
|
|
|
@end
|
|
|
|
|
2011-06-24 07:16:19 +08:00
|
|
|
@interface INTF3 : Y // expected-error {{attempting to use the forward class 'Y' as superclass of 'INTF3'}} \
|
2010-01-07 07:44:25 +08:00
|
|
|
// expected-note{{'INTF3' declared here}}
|
2007-09-21 01:54:07 +08:00
|
|
|
@end
|
|
|
|
|
2008-11-24 06:46:27 +08:00
|
|
|
@interface INTF1 // expected-error {{duplicate interface definition for class 'INTF1'}}
|
2007-09-21 01:54:07 +08:00
|
|
|
@end
|
2008-03-29 05:37:05 +08:00
|
|
|
|
|
|
|
@implementation SUPER
|
|
|
|
- (void)dealloc {
|
2011-01-24 01:21:34 +08:00
|
|
|
[super dealloc]; // expected-error {{'SUPER' cannot use 'super' because it is a root class}}
|
2008-03-29 05:37:05 +08:00
|
|
|
}
|
|
|
|
@end
|
2009-07-10 06:08:26 +08:00
|
|
|
|
|
|
|
@interface RecursiveClass : RecursiveClass // expected-error {{trying to recursively use 'RecursiveClass' as superclass of 'RecursiveClass'}}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation RecursiveClass
|
|
|
|
@end
|
|
|
|
|
2010-01-05 01:27:12 +08:00
|
|
|
@implementation iNTF3 // expected-warning{{cannot find interface declaration for 'iNTF3'; did you mean 'INTF3'?}}
|
|
|
|
@end
|