diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-02-17 22:05:48 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-02-17 22:05:48 +0000 |
commit | b636b904c229f02d574a27b3f6f2a41c39a1d541 (patch) | |
tree | 146892ac295d3d9d8b8809e2c23253d3452e25d7 /clang/lib/Sema/SemaDecl.cpp | |
parent | 4083e038e918ccc1a5800f424c3e814bdd425e79 (diff) | |
download | bcm5719-llvm-b636b904c229f02d574a27b3f6f2a41c39a1d541.tar.gz bcm5719-llvm-b636b904c229f02d574a27b3f6f2a41c39a1d541.zip |
Add 'nopartial' qualifier for availability attributes.
An optional nopartial can be placed after the platform name.
int bar() __attribute__((availability(macosx,nopartial,introduced=10.12))
When deploying back to a platform version prior to when the declaration was
introduced, with 'nopartial', Clang emits an error specifying that the function
is not introduced yet; without 'nopartial', the behavior stays the same: the
declaration is `weakly linked`.
A member is added to the end of AttributeList to save the location of the
'nopartial' keyword. A bool member is added to AvailabilityAttr.
The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as
we handle unavailable cases.
Reviewed by Doug Gregor and Jordan Rose.
rdar://23791325
llvm-svn: 261163
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 3345a1bbecb..d79e2e287f2 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2196,7 +2196,7 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D, NewAttr = S.mergeAvailabilityAttr(D, AA->getRange(), AA->getPlatform(), AA->getIntroduced(), AA->getDeprecated(), AA->getObsoleted(), AA->getUnavailable(), - AA->getMessage(), AMK, + AA->getMessage(), AA->getNopartial(), AMK, AttrSpellingListIndex); else if (const auto *VA = dyn_cast<VisibilityAttr>(Attr)) NewAttr = S.mergeVisibilityAttr(D, VA->getRange(), VA->getVisibility(), |