Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | @interface Super @end |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame^] | 4 | Super s1; // expected-error{{Objective-C type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 5 | |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame^] | 6 | extern Super e1; // expected-error{{Objective-C type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 7 | |
| 8 | struct S { |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame^] | 9 | Super s1; // expected-error{{Objective-C 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 | { |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame^] | 16 | Super ivar1; // expected-error{{Objective-C 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 { |
| 21 | Super objField; // expected-error{{Objective-C type cannot be statically allocated}} |
| 22 | }; |
| 23 | |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 24 | @interface MyIntf |
| 25 | { |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame^] | 26 | Super<P1> ivar1; // expected-error{{Objective-C type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 27 | } |
| 28 | @end |
| 29 | |
Steve Naroff | ccef371 | 2009-02-20 22:59:16 +0000 | [diff] [blame^] | 30 | Super foo(Super parm1) { // expected-error{{Objective-C type cannot be passed by value}} |
| 31 | Super p1; // expected-error{{Objective-C type cannot be statically allocated}} |
Fariborz Jahanian | e7f64cc | 2007-10-12 22:10:42 +0000 | [diff] [blame] | 32 | return p1; |
| 33 | } |