Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 2 | |
| 3 | @interface Super @end |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 4 | Super s1; // expected-error{{interface type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 5 | |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 6 | extern Super e1; // expected-error{{interface type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 7 | |
| 8 | struct S { |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 9 | Super s1; // expected-error{{interface type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 10 | }; |
| 11 | |
| 12 | @protocol P1 @end |
| 13 | |
| 14 | @interface INTF |
| 15 | { |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 16 | Super ivar1; // expected-error{{interface type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 17 | } |
| 18 | @end |
| 19 | |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame] | 20 | struct whatever { |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 21 | Super objField; // expected-error{{interface type cannot be statically allocated}} |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame] | 22 | }; |
| 23 | |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 24 | @interface MyIntf |
| 25 | { |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 26 | Super<P1> ivar1; // expected-error{{interface type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 27 | } |
| 28 | @end |
| 29 | |
Fariborz Jahanian | e9f5581 | 2010-04-07 00:22:00 +0000 | [diff] [blame] | 30 | Super foo( // expected-error{{interface interface type 'Super' cannot be returned by value; did you forget * in 'Super'}} |
| 31 | Super parm1) { // expected-error{{interface interface type 'Super' cannot be passed by value; did you forget * in 'Super'}} |
Chris Lattner | 05af262 | 2009-04-12 08:25:48 +0000 | [diff] [blame] | 32 | Super p1; // expected-error{{interface type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 33 | return p1; |
| 34 | } |
Fariborz Jahanian | acf2d13 | 2009-08-12 18:17:53 +0000 | [diff] [blame] | 35 | |
| 36 | @interface NSMutableSet @end |
| 37 | |
| 38 | @interface DVTDummyAnnotationProvider |
| 39 | @property(readonly) NSMutableSet annotations; // expected-error{{interface type cannot be statically allocated}} |
| 40 | |
| 41 | @end |
| 42 | |