blob: 540000b248277fd0c838c2d490b922c74c6aaa3e [file] [log] [blame]
Daniel Dunbara45cf5b2009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +00002
3@interface Super @end
Steve Naroff32606412009-02-20 22:59:16 +00004Super s1; // expected-error{{Objective-C type cannot be statically allocated}}
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +00005
Steve Naroff32606412009-02-20 22:59:16 +00006extern Super e1; // expected-error{{Objective-C type cannot be statically allocated}}
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +00007
8struct S {
Steve Naroff32606412009-02-20 22:59:16 +00009 Super s1; // expected-error{{Objective-C type cannot be statically allocated}}
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +000010};
11
12@protocol P1 @end
13
14@interface INTF
15{
Steve Naroff32606412009-02-20 22:59:16 +000016 Super ivar1; // expected-error{{Objective-C type cannot be statically allocated}}
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +000017}
18@end
19
Steve Naroff32606412009-02-20 22:59:16 +000020struct whatever {
21 Super objField; // expected-error{{Objective-C type cannot be statically allocated}}
22};
23
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +000024@interface MyIntf
25{
Steve Naroff32606412009-02-20 22:59:16 +000026 Super<P1> ivar1; // expected-error{{Objective-C type cannot be statically allocated}}
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +000027}
28@end
29
Chris Lattner347eec92009-04-11 19:17:25 +000030Super foo( // expected-error{{Objective-C interface type 'Super' cannot be returned by value}}
31 Super parm1) { // expected-error{{Objective-C interface type 'Super' cannot be passed by value}}
Steve Naroff32606412009-02-20 22:59:16 +000032 Super p1; // expected-error{{Objective-C type cannot be statically allocated}}
Fariborz Jahanianecfe4f12007-10-12 22:10:42 +000033 return p1;
34}