]> granicus.if.org Git - clang/commit
Sema: Treat 'strict' availability flag like unavailable
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 8 Mar 2016 06:12:54 +0000 (06:12 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 8 Mar 2016 06:12:54 +0000 (06:12 +0000)
commita1d201fccaf0e072dc2c70c2ecbc6c129087e3bd
tree4aa906b332952c0cccedbdb3a0e3f73c5dbc39d8
parent7922250d3145a321da17e7ddebd818b0e3bbe723
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
lib/AST/DeclBase.cpp
lib/Sema/SemaExpr.cpp
test/Sema/attr-availability-macosx.c