Add support for __builtin_available to __has_builtin
rdar://31576715 llvm-svn: 300049
This commit is contained in:
parent
da7b15df70
commit
53b4b1846d
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue