[PATCH] D56469: [ObjC] Allow the use of implemented unavailable methods from within the @implementation context

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 8 18:08:31 PST 2019


arphaman created this revision.
arphaman added a reviewer: erik.pilkington.
Herald added subscribers: cfe-commits, dexonsmith, jkorous.

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 patch addresses the aforementioned regression.

rdar://47134898


Repository:
  rC Clang

https://reviews.llvm.org/D56469

Files:
  lib/Sema/SemaDeclAttr.cpp
  test/SemaObjC/call-unavailable-init-in-self.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56469.180777.patch
Type: text/x-patch
Size: 4114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190109/14eccc81/attachment.bin>


More information about the cfe-commits mailing list