summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-03-17 03:09:55 +0000
committerManman Ren <manman.ren@gmail.com>2016-03-17 03:09:55 +0000
commita7c4760c8efa0e7ad3564bb1a0966bf8940463cf (patch)
treed404671d0d800ddb0aea795b9c87a16cd3e7f5b0 /clang/test
parentb76c02771786ecb235ed6da6dda845e2a06330be (diff)
downloadbcm5719-llvm-a7c4760c8efa0e7ad3564bb1a0966bf8940463cf.tar.gz
bcm5719-llvm-a7c4760c8efa0e7ad3564bb1a0966bf8940463cf.zip
Add an optional named argument (replacement = "xxx") to AvailabilityAttr.
This commit adds a named argument to AvailabilityAttr, while r263652 adds an optional string argument to __attribute__((deprecated)). This enables the compiler to provide Fix-Its for deprecated declarations. rdar://20588929 llvm-svn: 263687
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/attr-deprecated-replacement-fixit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-deprecated-replacement-fixit.cpp b/clang/test/SemaCXX/attr-deprecated-replacement-fixit.cpp
index 9a2d0f409aa..8e0af7a648d 100644
--- a/clang/test/SemaCXX/attr-deprecated-replacement-fixit.cpp
+++ b/clang/test/SemaCXX/attr-deprecated-replacement-fixit.cpp
@@ -8,9 +8,17 @@
#error "Missing __has_feature"
#endif
+#if !__has_feature(attribute_availability_with_replacement)
+#error "Missing __has_feature"
+#endif
+
void f_8(int) __attribute__((deprecated("message", "new8"))); // expected-note {{'f_8' has been explicitly marked deprecated here}}
void new8(int);
+void f_2(int) __attribute__((availability(macosx,deprecated=9.0,replacement="new2"))); // expected-note {{'f_2' has been explicitly marked deprecated here}}
+void new2(int);
void test() {
f_8(0); // expected-warning{{'f_8' is deprecated}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:6}:"new8"
+ f_2(0); // expected-warning{{'f_2' is deprecated: first deprecated in OS X 9.0}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:6}:"new2"
}
OpenPOWER on IntegriCloud