Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 2 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 3 | typedef int INTF3; // expected-note {{previous definition is here}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 4 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 5 | @interface SUPER @end // expected-note {{previous definition is here}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 6 | |
| 7 | @interface OBJECT @end |
| 8 | |
| 9 | @interface INTF : OBJECT |
| 10 | @end |
| 11 | |
| 12 | @implementation INTF @end |
| 13 | |
| 14 | @implementation INTF // expected-error {{reimplementation of class 'INTF'}} |
| 15 | @end |
| 16 | |
| 17 | |
| 18 | @interface INTF1 : OBJECT |
| 19 | @end |
| 20 | |
| 21 | @implementation INTF1 : SUPER // expected-error {{conflicting super class name 'SUPER'}} |
| 22 | @end |
| 23 | |
| 24 | @interface INTF2 |
| 25 | @end |
| 26 | |
| 27 | @implementation INTF2 : SUPR // expected-error {{cannot find interface declaration for 'SUPR', superclass of 'INTF2'}} |
| 28 | @end |
| 29 | |
| 30 | @implementation INTF3 @end // expected-error {{redefinition of 'INTF3' as different kind of symbol}} |
| 31 | |
| 32 | @implementation INTF4 @end // expected-warning {{cannot find interface declaration for 'INTF4'}} |
| 33 | |
Fariborz Jahanian | 77a6be4 | 2009-04-23 21:49:04 +0000 | [diff] [blame^] | 34 | @class INTF5; |
| 35 | |
| 36 | @implementation INTF5 { // expected-warning {{cannot find interface declaration for 'INTF5'}} |
| 37 | int x; |
| 38 | } |
| 39 | @end |
| 40 | |