[cfe-commits] r64831 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def lib/Sema/SemaDeclAttr.cpp
Ted Kremenek
kremenek at apple.com
Tue Feb 17 14:20:20 PST 2009
Author: kremenek
Date: Tue Feb 17 16:20:20 2009
New Revision: 64831
URL: http://llvm.org/viewvc/llvm-project?rev=64831&view=rev
Log:
Attribute 'iboutlet' can be applied to Objective-C property declarations.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def?rev=64831&r1=64830&r2=64831&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.def Tue Feb 17 16:20:20 2009
@@ -410,8 +410,8 @@
"'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,
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=64831&r1=64830&r2=64831&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Tue Feb 17 16:20:20 2009
@@ -287,10 +287,10 @@
// 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) {
More information about the cfe-commits
mailing list