Attribute 'iboutlet' can be applied to Objective-C property declarations.

llvm-svn: 64831
This commit is contained in:
Ted Kremenek 2009-02-17 22:20:20 +00:00
parent 43a5d9e409
commit 2620a06fe7
2 changed files with 5 additions and 5 deletions

View File

@ -410,8 +410,8 @@ DIAG(err_attribute_cleanup_func_arg_incompatible_type, ERROR,
"'cleanup' function %0 parameter has type %1, expected type %2")
// Clang-Specific Attributes
DIAG(err_attribute_iboutlet_non_ivar, ERROR,
"'iboutlet' attribute can only be applied to instance variables")
DIAG(err_attribute_iboutlet, ERROR,
"'iboutlet' attribute can only be applied to instance variables or properties")
DIAG(err_attribute_overloadable_not_function, ERROR,
"'overloadable' attribute can only be applied to a function")
DIAG(err_attribute_overloadable_missing, ERROR,

View File

@ -287,10 +287,10 @@ static void HandleIBOutletAttr(Decl *d, const AttributeList &Attr, Sema &S) {
// The IBOutlet attribute only applies to instance variables of Objective-C
// classes.
if (ObjCIvarDecl *ID = dyn_cast<ObjCIvarDecl>(d))
ID->addAttr(new IBOutletAttr());
if (isa<ObjCIvarDecl>(d) || isa<ObjCPropertyDecl>(d))
d->addAttr(new IBOutletAttr());
else
S.Diag(Attr.getLoc(), diag::err_attribute_iboutlet_non_ivar);
S.Diag(Attr.getLoc(), diag::err_attribute_iboutlet);
}
static void HandleNonNullAttr(Decl *d, const AttributeList &Attr, Sema &S) {