blob: 46338bb4becf7248531b77fce5b363a0df63e7e3 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +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
Richard Trieu2fe9b7f2011-12-15 00:38:15 +000030Super foo( // expected-error{{interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
31 Super parm1) { // expected-error{{interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
Chris Lattner05af2622009-04-12 08:25:48 +000032 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