aboutsummaryrefslogtreecommitdiff
path: root/docs/AutomaticReferenceCounting.html
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-08-20 23:36:59 +0000
committerJohn McCall <rjmccall@apple.com>2012-08-20 23:36:59 +0000
commitd64c2eb83d7ec86faa4f2554935a977a19573f59 (patch)
tree3d58e7ca56a49f46c7c71c6064c8af887e466081 /docs/AutomaticReferenceCounting.html
parentbf3a96650c449a5f8dd1a818b3ce1afa8dddfc39 (diff)
Fix a pair of bugs relating to properties in ARC.
First, when synthesizing an explicitly strong/retain/copy property of Class type, don't pretend during compatibility checking that the property is actually assign. Instead, resolve incompatibilities by secretly changing the type of *implicitly* __unsafe_unretained Class ivars to be strong. This is moderately evil but better than what we were doing. Second, when synthesizing the setter for a strong property of non-retainable type, be sure to use objc_setProperty. This is possible when the property is decorated with the NSObject attribute. This is an ugly, ugly corner of the language, and we probably ought to deprecate it. The first is rdar://problem/12039404; the second was noticed by inspection while fixing the first. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/AutomaticReferenceCounting.html')
-rw-r--r--docs/AutomaticReferenceCounting.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/AutomaticReferenceCounting.html b/docs/AutomaticReferenceCounting.html
index 3f1ccaf672..2fd82dda65 100644
--- a/docs/AutomaticReferenceCounting.html
+++ b/docs/AutomaticReferenceCounting.html
@@ -888,6 +888,15 @@ from non-ARC practice was acceptable because we had conservatively
banned the synthesis in order to give ourselves exactly this
leeway.</p></div>
+<p>Applying <tt>__attribute__((NSObject))</tt> to a property not of
+retainable object pointer type has the same behavior it does outside
+of ARC: it requires the property type to be some sort of pointer and
+permits the use of modifiers other than <tt>assign</tt>. These
+modifiers only affect the synthesized getter and setter; direct
+accesses to the ivar (even if synthesized) still have primitive
+semantics, and the value in the ivar will not be automatically
+released during deallocation.</p>
+
</div> <!-- ownership.spelling.property -->
</div> <!-- ownership.spelling -->