blob: b58fa68337be747f047cdf848f23d1e84a20dc07 [file] [log] [blame]
Fariborz Jahanian1147c5e2009-12-14 17:36:25 +00001// RUN: clang -cc1 -fsyntax-only -verify %s
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +00002
3@interface Super @end
Chris Lattner05af2622009-04-12 08:25:48 +00004Super s1; // expected-error{{interface type cannot be statically allocated}}
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +00005
Chris Lattner05af2622009-04-12 08:25:48 +00006extern Super e1; // expected-error{{interface type cannot be statically allocated}}
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +00007
8struct S {
Chris Lattner05af2622009-04-12 08:25:48 +00009 Super s1; // expected-error{{interface type cannot be statically allocated}}
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +000010};
11
12@protocol P1 @end
13
14@interface INTF
15{
Chris Lattner05af2622009-04-12 08:25:48 +000016 Super ivar1; // expected-error{{interface type cannot be statically allocated}}
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +000017}
18@end
19
Steve Naroffccef3712009-02-20 22:59:16 +000020struct whatever {
Chris Lattner05af2622009-04-12 08:25:48 +000021 Super objField; // expected-error{{interface type cannot be statically allocated}}
Steve Naroffccef3712009-02-20 22:59:16 +000022};
23
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +000024@interface MyIntf
25{
Chris Lattner05af2622009-04-12 08:25:48 +000026 Super<P1> ivar1; // expected-error{{interface type cannot be statically allocated}}
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +000027}
28@end
29
Chris Lattner05af2622009-04-12 08:25:48 +000030Super foo( // expected-error{{interface interface type 'Super' cannot be returned by value}}
31 Super parm1) { // expected-error{{interface interface type 'Super' cannot be passed by value}}
32 Super p1; // expected-error{{interface type cannot be statically allocated}}
Fariborz Jahaniane7f64cc2007-10-12 22:10:42 +000033 return p1;
34}
Fariborz Jahanianacf2d132009-08-12 18:17:53 +000035
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