1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @interface Foo // expected-note {{previous definition is here}}
6 float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}}
8 @class Bar; // expected-note {{previous definition is here}}
10 typedef int Bar; // expected-error {{redefinition of 'Bar' as different kind of symbol}}
12 @implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}}
16 typedef int OBJECT; // expected-note {{previous definition is here}}
18 @class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
21 typedef int Gorf; // expected-note {{previous definition is here}}
23 @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}}
25 void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
30 @protocol P -im1; @end
31 @protocol Q -im2; @end
32 @interface A<P> @end // expected-note {{previous definition is here}}
33 @interface A<Q> @end // expected-error {{duplicate interface definition for class 'A'}}
35 @protocol PP<P> @end // expected-note {{previous definition is here}}
36 @protocol PP<Q> @end // expected-warning {{duplicate protocol definition of 'PP'}}
38 @interface A(Cat)<P> @end // expected-note {{previous definition is here}}
39 @interface A(Cat)<Q> @end // expected-warning {{duplicate definition of category 'Cat' on interface 'A'}}
43 NSString * TestBaz; // expected-note {{previous definition is here}}
44 NSString * const TestBaz; // expected-error {{redefinition of 'TestBaz' with a different type}}