"property synthesized here">;
def error_synthesize_category_decl : Error<
"@synthesize not allowed in a category's implementation">;
+def error_synthesize_on_class_property : Error<
+ "@synthesize not allowed on a class property %0">;
def error_reference_property : Error<
"property of reference type is not supported">;
def error_missing_property_interface : Error<
Diag(PropertyLoc, diag::error_bad_property_decl) << IDecl->getDeclName();
return nullptr;
}
+ if (property->isClassProperty() && Synthesize) {
+ Diag(PropertyLoc, diag::error_synthesize_on_class_property) << PropertyId;
+ return nullptr;
+ }
unsigned PIkind = property->getPropertyAttributesAsWritten();
if ((PIkind & (ObjCPropertyDecl::OBJC_PR_atomic |
ObjCPropertyDecl::OBJC_PR_nonatomic) ) == 0) {
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// expected-no-diagnostics
@interface Root
-(id) alloc;
@implementation A
@dynamic x; // refers to the instance property
@dynamic (class) x; // refers to the class property
-@synthesize z;
+@synthesize z, c2; // expected-error {{@synthesize not allowed on a class property 'c2'}}
@dynamic c; // refers to the class property
@end