diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-17 22:20:20 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-17 22:20:20 +0000 |
commit | 327426076e1acc8217307cb236269ccf08c18fe6 (patch) | |
tree | 8a305ae617516638412de527017e10234d69f261 | |
parent | b7d0844c887a72064b624dc6df12cbe1441f69d0 (diff) |
Attribute 'iboutlet' can be applied to Objective-C property declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64831 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.def | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.def b/include/clang/Basic/DiagnosticSemaKinds.def index 11db059c26..19d9b65ffa 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.def +++ b/include/clang/Basic/DiagnosticSemaKinds.def @@ -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, diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 1d83605316..c4caec4d42 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -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) { |