blob: b8779cc3e07843cb871a70dc014ca3ef6479256d [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanianb31cb7f2009-03-21 18:06:45 +00002
3@interface XX
Steve Naroff87454162009-04-13 17:58:46 +00004int x; // expected-error {{cannot declare variable inside @interface or @protocol}}
5int one=1; // expected-error {{cannot declare variable inside @interface or @protocol}}
Fariborz Jahanianb31cb7f2009-03-21 18:06:45 +00006@end
7
8@protocol PPP
Steve Naroff87454162009-04-13 17:58:46 +00009int ddd; // expected-error {{cannot declare variable inside @interface or @protocol}}
Fariborz Jahanianb31cb7f2009-03-21 18:06:45 +000010@end
11
12@interface XX(CAT)
Steve Naroff87454162009-04-13 17:58:46 +000013 char * III; // expected-error {{cannot declare variable inside @interface or @protocol}}
Fariborz Jahanianb31cb7f2009-03-21 18:06:45 +000014 extern int OK;
15@end
16
Steve Naroff87454162009-04-13 17:58:46 +000017@interface XX()
18 char * III2; // expected-error {{cannot declare variable inside @interface or @protocol}}
19 extern int OK2;
20@end
21
Fariborz Jahanianb31cb7f2009-03-21 18:06:45 +000022
23int main( int argc, const char *argv[] ) {
24 return x+one;
25}
26