]> granicus.if.org Git - clang/commitdiff
Attribute 'iboutlet' can be applied to Objective-C property declarations.
authorTed Kremenek <kremenek@apple.com>
Tue, 17 Feb 2009 22:20:20 +0000 (22:20 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 17 Feb 2009 22:20:20 +0000 (22:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64831 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.def
lib/Sema/SemaDeclAttr.cpp

index 11db059c269ddfe972ca76416b00f0dd981c903b..19d9b65ffaad4bcfe3e8bc6cf759f028bc90eefb 100644 (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,
index 1d83605316cea13b143b14d0382a9c17a88da1f4..c4caec4d425a5f0fab760e3a66be2354c4a3a98c 100644 (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) {