]> granicus.if.org Git - clang/commit
[ObjC] Allow the use of implemented unavailable methods from within
authorAlex Lorenz <arphaman@gmail.com>
Wed, 9 Jan 2019 22:31:37 +0000 (22:31 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 9 Jan 2019 22:31:37 +0000 (22:31 +0000)
commitb01820327c555b8e32787e728892d4b89288e700
treed465993019702f72d0dec9dfd5cda0b2fa4fcb30
parent05d16b5603d658446d6b5e1e31af924959d00026
[ObjC] Allow the use of implemented unavailable methods from within
the @implementation context

In Objective-C, it's common for some frameworks to mark some methods like init
as unavailable in the @interface to prohibit their usage. However, these
frameworks then often implemented said method and refer to it in another method
that acts as a factory for that object. The recent change to how messages to
self are type checked in clang (r349841) introduced a regression which started
to prohibit this pattern with an X is unavailable error. This commit addresses
the aforementioned regression.

rdar://47134898

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350768 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/call-unavailable-init-in-self.m [new file with mode: 0644]