Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 @interface XX
      4 int x;  // expected-error {{cannot declare variable inside @interface or @protocol}}
      5 int one=1;  // expected-error {{cannot declare variable inside @interface or @protocol}}
      6 @end
      7 
      8 @protocol PPP
      9 int ddd; // expected-error {{cannot declare variable inside @interface or @protocol}}
     10 @end
     11 
     12 @interface XX(CAT)
     13   char * III; // expected-error {{cannot declare variable inside @interface or @protocol}}
     14   extern int OK;
     15 @end
     16 
     17 @interface XX()
     18   char * III2; // expected-error {{cannot declare variable inside @interface or @protocol}}
     19   extern int OK2;
     20 @end
     21 
     22 
     23 int main( int argc, const char *argv[] ) {
     24     return x+one;
     25 }
     26 
     27