llvm-project/clang-tools-extra/docs
Stephane Moore b0c1f8c09e [clang-tidy] Add a check for [super self] in initializers 🔍
Summary:
This check aims to address a relatively common benign error where
Objective-C subclass initializers call -self on their superclass instead
of invoking a superclass initializer, typically -init. The error is
typically benign because libobjc recognizes that improper initializer
chaining is common¹.

One theory for the frequency of this error might be that -init and -self
have the same return type which could potentially cause inappropriate
autocompletion to -self instead of -init. The equal selector lengths and
triviality of common initializer code probably contribute to errors like
this slipping through code review undetected.

This check aims to flag errors of this form in the interests of
correctness and reduce incidence of initialization failing to chain to
-[NSObject init].

[1] "In practice, it will be hard to rely on this function.
     Many classes do not properly chain -init calls."
From  _objc_rootInit in https://opensource.apple.com/source/objc4/objc4-750.1/runtime/NSObject.mm.auto.html.

Test Notes:
Verified via `make check-clang-tools`.

Subscribers: mgorny, xazax.hun, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59806

llvm-svn: 358620
2019-04-17 22:29:06 +00:00
..
_static Added more detailed documentation for clangd 2019-02-27 15:53:05 +00:00
_templates Added more detailed documentation for clangd 2019-02-27 15:53:05 +00:00
clang-tidy [clang-tidy] Add a check for [super self] in initializers 🔍 2019-04-17 22:29:06 +00:00
clangd [clangd] Fix a typo in doc. 2019-03-13 15:22:31 +00:00
CMakeLists.txt docs: Fix Sphinx detection with out-of-tree builds 2017-05-09 11:11:52 +00:00
ModularizeUsage.rst Remove trailing whitespace in docs and clang-tidy sources. 2016-12-13 16:38:45 +00:00
README.txt Updated the documentation build instructions for the current CMake build system 2019-02-25 13:03:44 +00:00
ReleaseNotes.rst [clang-tidy] Add a check for [super self] in initializers 🔍 2019-04-17 22:29:06 +00:00
clang-doc.rst [Documentation] Use HTTPS whenever possible. 2019-01-22 19:19:48 +00:00
clang-include-fixer.rst Rename directory housing clang-include-fixer to be eponymous 2019-03-25 14:09:10 +00:00
clang-modernize.rst Orphaning these RST files; each one is retained only for link backwards compatibility. 2015-12-28 19:59:15 +00:00
clang-rename.rst Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
clang-tidy.rst [Documentation] Use HTTPS whenever possible. 2019-01-22 19:19:48 +00:00
clangd.rst [clangd] Redirect clangd page. 2019-03-08 09:56:42 +00:00
conf.py Revert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present" 2019-03-13 08:15:03 +00:00
cpp11-migrate.rst Orphaning these RST files; each one is retained only for link backwards compatibility. 2015-12-28 19:59:15 +00:00
doxygen-mainpage.dox [docs] Fix docs to work with doxygen 1.8.11 2016-03-03 10:45:59 +00:00
doxygen.cfg.in Rename directory housing clang-include-fixer to be eponymous 2019-03-25 14:09:10 +00:00
index.rst Rename directory housing clang-include-fixer to be eponymous 2019-03-25 14:09:10 +00:00
make.bat
modularize.rst [Documentation] Use HTTPS whenever possible. 2019-01-22 19:19:48 +00:00
pp-trace.rst [pp-trace] Delete redundant clang:: 2019-03-24 07:31:21 +00:00

README.txt

----------------------------------
Documentation in clang-tools-extra
----------------------------------

To generate documentation in HTML format from files in clang-tools-extra/docs,
build the docs-clang-tools-html target.

To generate documentation from the source code using Doxygen, build the
doxygen-clang-tools target.