Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
Chris Lattner | 08631c5 | 2008-11-23 21:45:46 +0000 | [diff] [blame^] | 2 | // XFAIL |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 3 | |
| 4 | @interface Foo // expected-error {{previous definition is here}} |
| 5 | @end |
| 6 | |
| 7 | float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}} |
| 8 | |
| 9 | @class Bar; // expected-error {{previous definition is here}} |
| 10 | |
| 11 | typedef int Bar; // expected-error {{redefinition of 'Bar' as different kind of symbol}} |
| 12 | |
| 13 | @implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}} |
| 14 | @end |
| 15 | |
| 16 | |
| 17 | typedef int OBJECT; // expected-error {{previous definition is here}} |
| 18 | |
| 19 | @class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}} |
| 20 | |
| 21 | |
| 22 | typedef int Gorf; // expected-error {{previous definition is here}} |
| 23 | |
Steve Naroff | 3110251 | 2008-04-02 18:30:49 +0000 | [diff] [blame] | 24 | @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 25 | |
| 26 | void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}} |
| 27 | { |
| 28 | int Bar, Foo, FooBar; |
| 29 | } |
Steve Naroff | cfe8bf3 | 2008-11-18 19:15:30 +0000 | [diff] [blame] | 30 | |
| 31 | @protocol P -im1; @end |
| 32 | @protocol Q -im2; @end |
| 33 | @interface A<P> @end |
| 34 | @interface A<Q> @end // expected-error {{duplicate interface declaration for class 'A'}} |
| 35 | |
| 36 | @protocol PP<P> @end |
| 37 | @protocol PP<Q> @end // expected-error {{duplicate protocol declaration of 'PP'}} |
| 38 | |
| 39 | @interface A(Cat)<P> @end |
| 40 | @interface A(Cat)<Q> @end // expected-warning {{duplicate interface declaration for category 'A(Cat)'}} |