This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by arphaman on Jul 6 2017, 8:51 AM.

Details

Summary

The unguarded availability warnings in the protocol requirements of a protocol/class/category declaration can be avoided. This matches the behaviour of Swift's diagnostics.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Jul 6 2017, 8:51 AM
erik.pilkington added inline comments.Jul 6 2017, 9:46 AM
lib/Sema/SemaExpr.cpp
142 ↗(On Diff #105442)

Why are we doing this just for partials? Doesn't this also apply to unavailable/deprecated?

arphaman added inline comments.Jul 6 2017, 9:49 AM
lib/Sema/SemaExpr.cpp
142 ↗(On Diff #105442)

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.

lib/Sema/SemaExpr.cpp
142 ↗(On Diff #105442)

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.

arphaman added inline comments.Jul 6 2017, 10:20 AM
lib/Sema/SemaExpr.cpp
142 ↗(On Diff #105442)

Swift emits warnings about deprecated/unavailable protocols even in the list of protocol requirements. I'd prefer it if we had the same behaviour.

erik.pilkington accepted this revision.Jul 6 2017, 10:39 AM

LGTM, thanks!

lib/Sema/SemaExpr.cpp
132 ↗(On Diff #105442)

AvoidPartialAvailabilityChecks?

142 ↗(On Diff #105442)

OK, I agree that we should conform to what swift does here.

This revision is now accepted and ready to land.Jul 6 2017, 10:39 AM
This revision was automatically updated to reflect the committed changes.
arphaman marked an inline comment as done.