OSDN Git Service

[objc_direct] Allow for direct messages be sent to `self` when it is a Class
authorPierre Habouzit <phabouzit@apple.com>
Wed, 15 Jan 2020 03:51:08 +0000 (19:51 -0800)
committerPierre Habouzit <phabouzit@apple.com>
Fri, 24 Jan 2020 06:39:28 +0000 (22:39 -0800)
commit7596d3c50c4b265612d326369e2a015cf8c60801
tree5d0b85a4745f54b67eabb74e1b5879def5fd7556
parenta50567a31c7586bbee11323af603149c947b8d50
[objc_direct] Allow for direct messages be sent to `self` when it is a Class

Sending a message to `self` when it is const and within a class method
is safe because we know that `self` is the Class itself.

We can only relax this warning in ARC.

Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Radar-Id: rdar://problem/58581965
Differential Revision: https://reviews.llvm.org/D72747
clang/lib/Sema/SemaExprObjC.cpp
clang/test/SemaObjC/method-direct-arc.m [new file with mode: 0644]
clang/test/SemaObjC/method-direct.m