summaryrefslogtreecommitdiffstats
path: root/clang/docs
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-11-14 21:59:25 +0000
committerTed Kremenek <kremenek@apple.com>2011-11-14 21:59:25 +0000
commit1fcdaa9c058e65ca4251a3a752e42b5cbd1db736 (patch)
treec4f91aa23c68659656e58fc7392e751ee9bd936a /clang/docs
parent8e7fbcc3e4713f72444f940fc5bf3ba33b9ddd06 (diff)
downloadbcm5719-llvm-1fcdaa9c058e65ca4251a3a752e42b5cbd1db736.tar.gz
bcm5719-llvm-1fcdaa9c058e65ca4251a3a752e42b5cbd1db736.zip
ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.
llvm-svn: 144572
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/AutomaticReferenceCounting.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/docs/AutomaticReferenceCounting.html b/clang/docs/AutomaticReferenceCounting.html
index ab7debf20c1..0265bbdd385 100644
--- a/clang/docs/AutomaticReferenceCounting.html
+++ b/clang/docs/AutomaticReferenceCounting.html
@@ -1482,9 +1482,12 @@ implementation.</p></div>
<p>The <tt>self</tt> parameter variable of an Objective-C method is
never actually retained by the implementation. It is undefined
behavior, or at least dangerous, to cause an object to be deallocated
-during a message send to that object. To make this
-safe, <tt>self</tt> is implicitly <tt>const</tt> unless the method is
-in the <a href="#family.semantics.init"><tt>init</tt> family</a>.</p>
+during a message send to that object.</p>
+
+<p>To make this safe, for Objective-C instance methods <tt>self</tt> is
+implicitly <tt>const</tt> unless the method is in the <a
+href="#family.semantics.init"><tt>init</tt> family</a>. Further, <tt>self</tt>
+is <b>always</b> implicitly <tt>const</tt> within a class method.</p>
<div class="rationale"><p>Rationale: the cost of
retaining <tt>self</tt> in all methods was found to be prohibitive, as
OpenPOWER on IntegriCloud