This is an archive of the discontinued LLVM Phabricator instance.

[ObjC Availability] Fix false positive of -Wpartial-availability introduced in r277058
ClosedPublic

Authored by erik.pilkington on Aug 1 2016, 11:59 AM.

Details

Summary

As of r277058, Clang would incorrectly emit -Wpartial-availability for the following (when compiled with -mmacosx-verison-min=10.6):

int fn_10_5() __attribute__((availablity(macos, introduced=10.5)));
int use() __attribute__((availability(macos, introduced=10.4))) {
  return fn_10_5(); // incorrect warning: fn_10_5 is partial
}

The problem is that I didn't consider the base deployment target when getting the context version, so the availability of the context of the call to fn_10_5 was 10.4 (from the function), not 10.6 (from the deployment target). Therefore, a warning was emitted.

Thanks Nico Weber for pointing this out!

Diff Detail

Event Timeline

erik.pilkington retitled this revision from to [ObjC Availability] Fix false positive of -Wpartial-availability introduced in r277058.
erik.pilkington updated this object.
erik.pilkington added reviewers: manmanren, thakis.
erik.pilkington added a subscriber: cfe-commits.
thakis accepted this revision.Aug 1 2016, 12:02 PM
thakis edited edge metadata.

Thanks for the quick fix!

This revision is now accepted and ready to land.Aug 1 2016, 12:02 PM
This revision was automatically updated to reflect the committed changes.