forked from OSchip/llvm-project
Add a __has_feature check for the 'availability' attribute
llvm-svn: 128337
This commit is contained in:
parent
1baf38f5a6
commit
7bf3fbe6e1
|
@ -530,6 +530,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
|
|||
|
||||
return llvm::StringSwitch<bool>(II->getName())
|
||||
.Case("attribute_analyzer_noreturn", true)
|
||||
.Case("attribute_availability", true)
|
||||
.Case("attribute_cf_returns_not_retained", true)
|
||||
.Case("attribute_cf_returns_retained", true)
|
||||
.Case("attribute_deprecated_with_message", true)
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
#if !__has_feature(attribute_availability)
|
||||
# error 'availability' attribute is not available
|
||||
#endif
|
||||
|
||||
void f0() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
|
||||
|
||||
void f1() __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6)));
|
||||
|
|
Loading…
Reference in New Issue