2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-03-22 02:06:45 +08:00
|
|
|
|
|
|
|
@interface XX
|
2009-04-14 01:58:46 +08:00
|
|
|
int x; // expected-error {{cannot declare variable inside @interface or @protocol}}
|
|
|
|
int one=1; // expected-error {{cannot declare variable inside @interface or @protocol}}
|
2009-03-22 02:06:45 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol PPP
|
2009-04-14 01:58:46 +08:00
|
|
|
int ddd; // expected-error {{cannot declare variable inside @interface or @protocol}}
|
2009-03-22 02:06:45 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface XX(CAT)
|
2009-04-14 01:58:46 +08:00
|
|
|
char * III; // expected-error {{cannot declare variable inside @interface or @protocol}}
|
2009-03-22 02:06:45 +08:00
|
|
|
extern int OK;
|
|
|
|
@end
|
|
|
|
|
2009-04-14 01:58:46 +08:00
|
|
|
@interface XX()
|
|
|
|
char * III2; // expected-error {{cannot declare variable inside @interface or @protocol}}
|
|
|
|
extern int OK2;
|
|
|
|
@end
|
|
|
|
|
2009-03-22 02:06:45 +08:00
|
|
|
|
|
|
|
int main( int argc, const char *argv[] ) {
|
|
|
|
return x+one;
|
|
|
|
}
|
|
|
|
|