[PATCH] D33450: Warn about uses of `@available` that can't suppress the -Wunguarded-availability warnings
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 23 21:34:53 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:15747
+ // warn when it's used inappropriately (i.e. not if(@available)).
+ if (getCurFunctionOrMethodDecl())
+ getEnclosingFunction()->HasPotentialAvailabilityViolations = true;
----------------
erik.pilkington wrote:
> I believe this will not be set if we're rebuilding a templated function, we should also flag this from `TransformObjCAvailabilityCheckExpr` in TreeTransform.h.
On second thought, there is no point in doing that because we'd have already emitted a diagnostic from the pattern. This is correct as is.
Repository:
rL LLVM
https://reviews.llvm.org/D33450
More information about the cfe-commits
mailing list