Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | b31cb7f | 2009-03-21 18:06:45 +0000 | [diff] [blame] | 2 | |
| 3 | @interface XX |
| 4 | int x; // expected-error {{cannot declare variable inside a class, protocol or category}} |
| 5 | int one=1; // expected-error {{cannot declare variable inside a class, protocol or category}} |
| 6 | @end |
| 7 | |
| 8 | @protocol PPP |
| 9 | int ddd; // expected-error {{cannot declare variable inside a class, protocol or category}} |
| 10 | @end |
| 11 | |
| 12 | @interface XX(CAT) |
| 13 | char * III; // expected-error {{cannot declare variable inside a class, protocol or category}} |
| 14 | extern int OK; |
| 15 | @end |
| 16 | |
| 17 | |
| 18 | int main( int argc, const char *argv[] ) { |
| 19 | return x+one; |
| 20 | } |
| 21 | |