Add support for __builtin_available to __has_builtin

rdar://31576715

llvm-svn: 300049
This commit is contained in:
Alex Lorenz 2017-04-12 11:03:25 +00:00
parent da7b15df70
commit 53b4b1846d
2 changed files with 6 additions and 0 deletions

View File

@ -1746,6 +1746,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
return llvm::StringSwitch<bool>(II->getName())
.Case("__make_integer_seq", LangOpts.CPlusPlus)
.Case("__type_pack_element", LangOpts.CPlusPlus)
.Case("__builtin_available", true)
.Default(false);
}
});

View File

@ -20,3 +20,8 @@ void f() {
(void)@available(macos); // expected-error{{expected a version}}
(void)@available; // expected-error{{expected '('}}
}
#if __has_builtin(__builtin_available)
#error expected
// expected-error@-1 {{expected}}
#endif