Files
clang-p2996/clang/test/Sema/availability-guard-format.mm
Jan Korous 2325569eaa Use dotted format of version tuple for availability diagnostics
E. g. use "10.11" instead of "10_11".

We are maintaining backward compatibility by parsing underscore-delimited version tuples but no longer keep track of the separator and using dot format for output.

Differential Revision: https://reviews.llvm.org/D46747

rdar://problem/39845032

llvm-svn: 332598
2018-05-17 11:51:49 +00:00

16 lines
753 B
Plaintext

// RUN: %clang_cc1 -triple x86_64-apple-macosx-10.11 -Wunguarded-availability -fdiagnostics-parseable-fixits -fsyntax-only -verify %s
// Testing that even for source code using '_' as a delimiter in availability version tuple '.' is actually used in diagnostic output as a delimiter.
@interface foo
- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has been explicitly marked partial here}}
@end
int main() {
[foo method_bar]; // \
// expected-warning {{'method_bar' is only available on macOS 10.12 or newer}} \
// expected-note {{enclose 'method_bar' in an @available check to silence this warning}} \
// CHECK: "fix-it:.*if (@available(macOS 10.12, *))"
return 0;
}