[cfe-commits] r108283 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/property-10.m
Fariborz Jahanian
fjahanian at apple.com
Tue Jul 13 15:04:56 PDT 2010
Author: fjahanian
Date: Tue Jul 13 17:04:56 2010
New Revision: 108283
URL: http://llvm.org/viewvc/llvm-project?rev=108283&view=rev
Log:
Check on property attributes which are declared
in class extensions (radar 8171968).
Modified:
cfe/trunk/lib/Sema/SemaObjCProperty.cpp
cfe/trunk/test/SemaObjC/property-10.m
Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=108283&r1=108282&r2=108283&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Tue Jul 13 17:04:56 2010
@@ -52,18 +52,22 @@
cast<ObjCContainerDecl>(ClassCategory.getAs<Decl>());
if (ObjCCategoryDecl *CDecl = dyn_cast<ObjCCategoryDecl>(ClassDecl))
- if (CDecl->IsClassExtension())
- return HandlePropertyInClassExtension(S, CDecl, AtLoc,
- FD, GetterSel, SetterSel,
- isAssign, isReadWrite,
- Attributes,
- isOverridingProperty, TSI,
- MethodImplKind);
-
+ if (CDecl->IsClassExtension()) {
+ DeclPtrTy Res = HandlePropertyInClassExtension(S, CDecl, AtLoc,
+ FD, GetterSel, SetterSel,
+ isAssign, isReadWrite,
+ Attributes,
+ isOverridingProperty, TSI,
+ MethodImplKind);
+ if (Res)
+ CheckObjCPropertyAttributes(Res, AtLoc, Attributes);
+ return Res;
+ }
+
DeclPtrTy Res = DeclPtrTy::make(CreatePropertyDecl(S, ClassDecl, AtLoc, FD,
- GetterSel, SetterSel,
- isAssign, isReadWrite,
- Attributes, TSI, MethodImplKind));
+ GetterSel, SetterSel,
+ isAssign, isReadWrite,
+ Attributes, TSI, MethodImplKind));
// Validate the attributes on the @property.
CheckObjCPropertyAttributes(Res, AtLoc, Attributes);
return Res;
Modified: cfe/trunk/test/SemaObjC/property-10.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-10.m?rev=108283&r1=108282&r2=108283&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-10.m (original)
+++ cfe/trunk/test/SemaObjC/property-10.m Tue Jul 13 17:04:56 2010
@@ -20,3 +20,9 @@
@property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}}
@end
+
+ at interface I0()
+ at property (retain) int PROP; // expected-error {{property with 'retain' attribute must be of object type}}
+ at property(nonatomic,copy) int (*PROP1)(); // expected-error {{property with 'copy' attribute must be of object type}}
+ at end
+
More information about the cfe-commits
mailing list