diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-10-23 23:30:08 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-10-23 23:30:08 +0000 |
commit | c95fe7ca31ce80eb045d36a40fe69c11119262df (patch) | |
tree | 4aba31c226d016f295f6c83fc451f8ff635a6c69 | |
parent | ffc9a71866108593eb86caf550107ce168176288 (diff) | |
download | bcm5719-llvm-c95fe7ca31ce80eb045d36a40fe69c11119262df.tar.gz bcm5719-llvm-c95fe7ca31ce80eb045d36a40fe69c11119262df.zip |
More wordsmithing on objc_requires_super documentation.
llvm-svn: 193288
-rw-r--r-- | clang/docs/LanguageExtensions.rst | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst index 0e365b40727..ca1b7ea364a 100644 --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -1181,19 +1181,23 @@ Objective-C requiring a call to ``super`` in an override -------------------------------------------------------- Some Objective-C classes allow a subclass to override a particular method in a -parent class but expect that the override chains to calling the same method in -the parent class. In such cases it is useful to be able to mark a method as -requiring this chaining behavior. For these cases, we provide an attribute to -designate that a method requires a "call to ``super``" in the overriden method -in the subclass. +parent class but expect that the overriding method also calls the overridden +method in the parent class. For these cases, we provide an attribute to +designate that a method requires a "call to ``super``" in the overriding +method in the subclass. -**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only be placed at the end of a method declaration: +**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only +be placed at the end of a method declaration: .. code-block:: objc - (void)foo __attribute__((objc_requires_super)); -This attribute can only be applied the method declarations within a class, and not a protocol. +This attribute can only be applied the method declarations within a class, and +not a protocol. Currently this attribute does not enforce any placement of +where the call occurs in the overriding method (such as in the case of +``-dealloc`` where the call must appear at the end). It checks only that it +exists. Note that on both OS X and iOS that the Foundation framework provides a convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this |