This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Make sure that -Wunguarded-availability emits notes at the right redeclaration
Changes PlannedPublic

Authored by erik.pilkington on Jul 23 2017, 2:04 PM.

Details

Reviewers
arphaman
Summary

This is done by modifying ShouldDiagnoseAvailabilityOfDecl() so that the OffendingDecl is the one with the original availability attribute. Also, keep track of this availability attribute so we don't have to constantly recompute it via getAttrForPlatform().

Thanks for taking a look!
Erik

Diff Detail

Event Timeline

erik.pilkington planned changes to this revision.Jul 23 2017, 9:04 PM

On second thought, I think it makes more sense to do this right before we emit a diagnostic so we have the most recent redecl with all the inherited availability attributes until then. I'll put a diff up for that tomorrow!