blob: b451d3634929ea79e94311a2c7c57e8d1c47ad70 [file] [log] [blame]
Fariborz Jahanian0399c1c2009-12-14 17:36:25 +00001// RUN: clang -cc1 -fsyntax-only -verify %s
Fariborz Jahanian629aed92009-03-21 18:06:45 +00002
3@interface XX
Steve Naroff42959b22009-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 Jahanian629aed92009-03-21 18:06:45 +00006@end
7
8@protocol PPP
Steve Naroff42959b22009-04-13 17:58:46 +00009int ddd; // expected-error {{cannot declare variable inside @interface or @protocol}}
Fariborz Jahanian629aed92009-03-21 18:06:45 +000010@end
11
12@interface XX(CAT)
Steve Naroff42959b22009-04-13 17:58:46 +000013 char * III; // expected-error {{cannot declare variable inside @interface or @protocol}}
Fariborz Jahanian629aed92009-03-21 18:06:45 +000014 extern int OK;
15@end
16
Steve Naroff42959b22009-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 Jahanian629aed92009-03-21 18:06:45 +000022
23int main( int argc, const char *argv[] ) {
24 return x+one;
25}
26