blob: 8536a201def0e6d2538b1a394202e839de1ea449 [file] [log] [blame]
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00001// RUN: clang -fsyntax-only -verify %s
2
3@interface Foo // expected-error {{previous definition is here}}
4@end
5
6float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}}
7
8@class Bar; // expected-error {{previous definition is here}}
9
10typedef int Bar; // expected-error {{redefinition of 'Bar' as different kind of symbol}}
11
12@implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}}
13@end
14
15
16typedef int OBJECT; // expected-error {{previous definition is here}}
17
18@class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
19
20
21typedef int Gorf; // expected-error {{previous definition is here}}
22
Steve Naroff31102512008-04-02 18:30:49 +000023@interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +000024
25void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
26{
27 int Bar, Foo, FooBar;
28}
Steve Naroffcfe8bf32008-11-18 19:15:30 +000029
30@protocol P -im1; @end
31@protocol Q -im2; @end
32@interface A<P> @end
33@interface A<Q> @end // expected-error {{duplicate interface declaration for class 'A'}}
34
35@protocol PP<P> @end
36@protocol PP<Q> @end // expected-error {{duplicate protocol declaration of 'PP'}}
37
38@interface A(Cat)<P> @end
39@interface A(Cat)<Q> @end // expected-warning {{duplicate interface declaration for category 'A(Cat)'}}