Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
      2 
      3 @protocol SUPER; // expected-note {{protocol 'SUPER' has no definition}}
      4 
      5 @interface SUPER <SUPER> @end // expected-warning {{cannot find protocol definition for 'SUPER'}}
      6 
      7 typedef int INTF; //  expected-note {{previous definition is here}}
      8 
      9 @interface INTF @end // expected-error {{redefinition of 'INTF' as different kind of symbol}}
     10 
     11 @interface OBJECT @end	// expected-note {{previous definition is here}}
     12 
     13 @interface INTF1 : OBJECT @end // expected-note {{previous definition is here}}
     14 
     15 @interface INTF1 : OBJECT @end // expected-error {{duplicate interface definition for class 'INTF1'}}
     16 
     17 typedef int OBJECT; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
     18 
     19 typedef int OBJECT2; // expected-note 2 {{previous definition is here}}
     20 @interface INTF2 : OBJECT2 @end // expected-error {{redefinition of 'OBJECT2' as different kind of symbol}}
     21 
     22 @implementation INTF2 : OBJECT2 @end // expected-error {{redefinition of 'OBJECT2' as different kind of symbol}}
     23 
     24 @protocol PROTO;
     25 
     26 @interface INTF3 : PROTO @end // expected-error {{cannot find interface declaration for 'PROTO', superclass of 'INTF3'}}
     27 
     28 // Make sure we allow the following (for GCC compatibility).
     29 @interface NSObject @end
     30 typedef NSObject TD_NSObject;
     31 @interface XCElementUnit : TD_NSObject {}
     32 @end
     33 
     34 // Make sure we don't typo-correct to ourselves.
     35 @interface SomeClassSub : SomeClassSup // expected-error{{cannot find interface declaration for 'SomeClassSup', superclass of 'SomeClassSub'}}
     36 @end
     37