xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/invalid-objc-decls-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface Super @end
4*f4a2713aSLionel SambucSuper s1; // expected-error{{interface type cannot be statically allocated}}
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambucextern Super e1; // expected-error{{interface type cannot be statically allocated}}
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucstruct S {
9*f4a2713aSLionel Sambuc  Super s1; // expected-error{{interface type cannot be statically allocated}}
10*f4a2713aSLionel Sambuc};
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc@protocol P1 @end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@interface INTF
15*f4a2713aSLionel Sambuc{
16*f4a2713aSLionel Sambuc  Super ivar1; // expected-error{{interface type cannot be statically allocated}}
17*f4a2713aSLionel Sambuc}
18*f4a2713aSLionel Sambuc@end
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambucstruct whatever {
21*f4a2713aSLionel Sambuc  Super objField; // expected-error{{interface type cannot be statically allocated}}
22*f4a2713aSLionel Sambuc};
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambuc@interface MyIntf
25*f4a2713aSLionel Sambuc{
26*f4a2713aSLionel Sambuc  Super<P1> ivar1; // expected-error{{interface type cannot be statically allocated}}
27*f4a2713aSLionel Sambuc}
28*f4a2713aSLionel Sambuc@end
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel SambucSuper foo( // expected-error{{interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
31*f4a2713aSLionel Sambuc          Super parm1) { // expected-error{{interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
32*f4a2713aSLionel Sambuc	Super p1; // expected-error{{interface type cannot be statically allocated}}
33*f4a2713aSLionel Sambuc	return p1;
34*f4a2713aSLionel Sambuc}
35*f4a2713aSLionel Sambuc
36*f4a2713aSLionel Sambuc@interface NSMutableSet @end
37*f4a2713aSLionel Sambuc
38*f4a2713aSLionel Sambuc@interface DVTDummyAnnotationProvider
39*f4a2713aSLionel Sambuc  @property(readonly) NSMutableSet annotations;	// expected-error{{interface type cannot be statically allocated}}
40*f4a2713aSLionel Sambuc
41*f4a2713aSLionel Sambuc@end
42*f4a2713aSLionel Sambuc
43