diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-03-08 06:12:54 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-03-08 06:12:54 +0000 |
commit | a1d201fccaf0e072dc2c70c2ecbc6c129087e3bd (patch) | |
tree | 4aa906b332952c0cccedbdb3a0e3f73c5dbc39d8 /lib/AST/DeclBase.cpp | |
parent | 7922250d3145a321da17e7ddebd818b0e3bbe723 (diff) |
Sema: Treat 'strict' availability flag like unavailable
This is a follow-up to r261512, which made the 'strict' availability
attribute flag behave like 'unavailable'. However, that fix was
insufficient. The following case would (erroneously) error when the
deployment target was older than 10.9:
struct __attribute__((availability(macosx,strict,introduced=10.9))) A;
__attribute__((availability(macosx,strict,introduced=10.9))) void f(A*);
The use of A* in the argument list for f is valid here, since f and A
have the same availability.
The fix is to return AR_Unavailable from DeclBase::getAvailability
instead of AR_NotYetIntroduced. This also reverts the special handling
added in r261163, instead relying on the well-tested logic for
AR_Unavailable.
rdar://problem/23791325
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 27ccb7d5d7..5ec05a6604 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -432,7 +432,7 @@ static AvailabilityResult CheckAvailability(ASTContext &Context, << VTI << HintMessage; } - return AR_NotYetIntroduced; + return A->getStrict() ? AR_Unavailable : AR_NotYetIntroduced; } // Make sure that this declaration hasn't been obsoleted. |