| 1 |
// RUN: %clang_cc1 "-triple" "arm64-apple-macosx10.15" -fsyntax-only -verify %s |
| 2 |
|
| 3 |
__attribute__((availability(macos,introduced=11))) |
| 4 |
inline bool try_acquire() { |
| 5 |
return true; |
| 6 |
} |
| 7 |
|
| 8 |
template <class T> |
| 9 |
__attribute__((availability(macos,introduced=11))) |
| 10 |
bool try_acquire_for(T duration) { // expected-note{{'try_acquire_for<int>' has been marked as being introduced in macOS 11 here, but the deployment target is macOS 10.15}} |
| 11 |
return try_acquire(); |
| 12 |
} |
| 13 |
|
| 14 |
int main() { |
| 15 |
try_acquire_for(1); // expected-warning{{'try_acquire_for<int>' is only available on macOS 11 or newer}} |
| 16 |
// expected-note@-1{{enclose 'try_acquire_for<int>' in a __builtin_available check to silence this warning}} |
| 17 |
} |