def err_setter_type_void : Error<"type of setter must be void">;
def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
def err_objc_var_decl_inclass :
- Error<"cannot declare variable inside a class, protocol or category %0">;
+ Error<"cannot declare variable inside @interface or @protocol">;
def error_missing_method_context : Error<
"missing context for method declaration">;
def err_objc_property_attr_mutually_exclusive : Error<
if (VarDecl *VDecl = dyn_cast<VarDecl>(*I)) {
if (VDecl->getStorageClass() != VarDecl::Extern &&
VDecl->getStorageClass() != VarDecl::PrivateExtern)
- Diag(VDecl->getLocation(), diag::err_objc_var_decl_inclass)
- << cast<NamedDecl>(ClassDecl)->getDeclName();
+ Diag(VDecl->getLocation(), diag::err_objc_var_decl_inclass);
}
}
}
// RUN: clang-cc -fsyntax-only -verify %s
@interface XX
-int x; // expected-error {{cannot declare variable inside a class, protocol or category}}
-int one=1; // expected-error {{cannot declare variable inside a class, protocol or category}}
+int x; // expected-error {{cannot declare variable inside @interface or @protocol}}
+int one=1; // expected-error {{cannot declare variable inside @interface or @protocol}}
@end
@protocol PPP
-int ddd; // expected-error {{cannot declare variable inside a class, protocol or category}}
+int ddd; // expected-error {{cannot declare variable inside @interface or @protocol}}
@end
@interface XX(CAT)
- char * III; // expected-error {{cannot declare variable inside a class, protocol or category}}
+ char * III; // expected-error {{cannot declare variable inside @interface or @protocol}}
extern int OK;
@end
+@interface XX()
+ char * III2; // expected-error {{cannot declare variable inside @interface or @protocol}}
+ extern int OK2;
+@end
+
int main( int argc, const char *argv[] ) {
return x+one;