[PATCH] D35061: [ObjC] Avoid the -Wunguarded-availability warnings for protocol requirements in protocol/class/category declarations

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 10:39:42 PDT 2017


erik.pilkington accepted this revision.
erik.pilkington added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: lib/Sema/SemaExpr.cpp:132
+                           bool ObjCPropertyAccess,
+                           bool AvoidAvailabilityChecks = false) {
   std::string Message;
----------------
`AvoidPartialAvailabilityChecks`?


================
Comment at: lib/Sema/SemaExpr.cpp:142
   if (Result == AR_NotYetIntroduced) {
+    if (AvoidAvailabilityChecks)
+      return;
----------------
arphaman wrote:
> erik.pilkington wrote:
> > arphaman wrote:
> > > erik.pilkington wrote:
> > > > Why are we doing this just for partials? Doesn't this also apply to unavailable/deprecated?
> > > We warned about the unavailable/deprecated protocols previously, so we should probably keep these warnings. The unguarded availability one is new, so we can drop it.
> > But this is strictly less diagnostics, dropping diagnostics for unavail/depr here won't break anything outside of clang tests. So if they don't make sense to emit, then there isn't any reason to keep them around.
> Swift emits warnings about deprecated/unavailable protocols even in the list of protocol requirements. I'd prefer it if we had the same behaviour.
OK, I agree that we should conform to what swift does here.


Repository:
  rL LLVM

https://reviews.llvm.org/D35061





More information about the cfe-commits mailing list