From 1fcdaa9c058e65ca4251a3a752e42b5cbd1db736 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 14 Nov 2011 21:59:25 +0000 Subject: ARC: make assignment to 'self' within class methods illegal. Fixes . llvm-svn: 144572 --- clang/docs/AutomaticReferenceCounting.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'clang/docs/AutomaticReferenceCounting.html') 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.

The self 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, self is implicitly const unless the method is -in the init family.

+during a message send to that object.

+ +

To make this safe, for Objective-C instance methods self is +implicitly const unless the method is in the init family. Further, self +is always implicitly const within a class method.

Rationale: the cost of retaining self in all methods was found to be prohibitive, as -- cgit v1.2.3