hanchenye-llvm-project/clang-tools-extra/unittests
Haojian Wu e010406e28 [clang-tidy ObjC] [3/3] New check objc-forbidden-subclassing
Summary:
This is part 3 of 3 of a series of changes to improve Objective-C
linting in clang-tidy.

This adds a new clang-tidy check `objc-forbidden-subclassing` which
ensures clients do not create subclasses of Objective-C classes which
are not designed to be subclassed.

(Note that for code under your control, you should use
__attribute__((objc_subclassing_restricted)) instead -- this
is intended for third-party APIs which cannot be modified.)

By default, the following classes (which are publicly documented
as not supporting subclassing) are forbidden from subclassing:

ABNewPersonViewController
ABPeoplePickerNavigationController
ABPersonViewController
ABUnknownPersonViewController
NSHashTable
NSMapTable
NSPointerArray
NSPointerFunctions
NSTimer
UIActionSheet
UIAlertView
UIImagePickerController
UITextInputMode
UIWebView

Clients can set a CheckOption
`objc-forbidden-subclassing.ClassNames` to a semicolon-separated
list of class names, which overrides this list.

Test Plan: `ninja check-clang-tools`

Patch by Ben Hamilton!

Reviewers: hokein, alexfh

Reviewed By: hokein

Subscribers: saidinwot, Wizard, srhines, mgorny, xazax.hun

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

llvm-svn: 316744
2017-10-27 07:41:36 +00:00
..
change-namespace [change-namespace] do not change type locs in defaulted functions. 2017-10-16 08:20:10 +00:00
clang-apply-replacements ClangApplyReplacementsTests: Add clangBasic in libdeps. 2017-07-15 06:32:10 +00:00
clang-move [clang-move] Find template class forward declarations more precisely. 2017-05-02 12:15:11 +00:00
clang-query
clang-tidy [clang-tidy ObjC] [3/3] New check objc-forbidden-subclassing 2017-10-27 07:41:36 +00:00
clangd [clangd] Report an error on findDefinitions/signatureHelp on an unopened file instead of crashing. 2017-10-26 12:28:13 +00:00
include/common
include-fixer [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly. 2017-03-13 15:55:59 +00:00
CMakeLists.txt [cmake] Support running extra clang tool tests without static analyzer 2017-08-29 05:58:08 +00:00