"default property attribute 'assign' not appropriate for non-gc object")
DIAG(err_objc_property_requires_object, ERROR,
"property with '%0' attribute must be of object type")
+DIAG(err_property_type, ERROR,
+ "property cannot have type %0 (array or function type)")
DIAG(err_objc_directive_only_in_protocol, ERROR,
"directive may only be specified in protocols only")
DIAG(err_missing_catch_finally, ERROR,
}
}
+ Type *t = T.getTypePtr();
+ if (t->isArrayType() || t->isFunctionType())
+ Diag(AtLoc, diag::err_property_type) << T;
+
ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, AtLoc,
FD.D.getIdentifier(), T);
// Regardless of setter/getter attribute, we save the default getter/setter
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+typedef int T[2];
+typedef void (F)(void);
+
+@interface A
+@property(assign) T p2; // expected-error {{property cannot have type 'T' (array or function type)}}
+
+@property(assign) F f2; // expected-error {{property cannot have type 'F' (array or function type)}}
+
+@end
+