From 5d6790c746d04636d284e47aea2c7cd68bbdf601 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 8 Mar 2016 06:12:54 +0000 Subject: 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 llvm-svn: 262915 --- clang/lib/AST/DeclBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/AST/DeclBase.cpp') diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 27ccb7d5d76..5ec05a6604b 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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. -- cgit v1.2.3