[cfe-commits] r86297 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/SemaObjC/continuation-class-err.m
Fariborz Jahanian
fjahanian at apple.com
Fri Nov 6 14:59:12 PST 2009
Author: fjahanian
Date: Fri Nov 6 16:59:12 2009
New Revision: 86297
URL: http://llvm.org/viewvc/llvm-project?rev=86297&view=rev
Log:
Since default writable attribute is 'assign', allow
specification of 'assign' (no warning to be issued),
when a continuation class makes a 'readonly' attribute
'readwrite' but also specifies the 'assign' attribute.
(this matches gcc's behavior and prevents exessive
warnings)/
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/continuation-class-err.m
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=86297&r1=86296&r2=86297&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Fri Nov 6 16:59:12 2009
@@ -1911,8 +1911,7 @@
unsigned PIkind = PIDecl->getPropertyAttributes();
if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
unsigned assignRetainCopyNonatomic =
- (ObjCPropertyDecl::OBJC_PR_assign |
- ObjCPropertyDecl::OBJC_PR_retain |
+ (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy |
ObjCPropertyDecl::OBJC_PR_nonatomic);
if ((Attributes & assignRetainCopyNonatomic) !=
Modified: cfe/trunk/test/SemaObjC/continuation-class-err.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/continuation-class-err.m?rev=86297&r1=86296&r2=86297&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/continuation-class-err.m (original)
+++ cfe/trunk/test/SemaObjC/continuation-class-err.m Fri Nov 6 16:59:12 2009
@@ -7,11 +7,13 @@
}
@property(readonly) id object; // expected-note {{property declared here}}
@property(readwrite, assign) id object1; // expected-note {{property declared here}}
+ at property (readonly) int indentLevel;
@end
@interface ReadOnly ()
@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}}
@property(readonly) id object1; // expected-error {{property declaration in continuation class of 'ReadOnly' is to change a 'readonly' property to 'readwrite'}}
+ at property (readwrite, assign) int indentLevel; // OK. assign the the default in any case.
@end
@protocol Proto
More information about the cfe-commits
mailing list