summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/attr-availability-macosx.c
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-05-06 19:57:16 +0000
committerManman Ren <manman.ren@gmail.com>2016-05-06 19:57:16 +0000
commit45b1ab11b7aae8b9877071b4e79aeb8dd7ac99af (patch)
tree47a51d842bdec0485af7b32ad6f95b9ac4c276a6 /clang/test/Sema/attr-availability-macosx.c
parent72315ab4e4a290ab33a4100fa5ad03109bf8e204 (diff)
downloadbcm5719-llvm-45b1ab11b7aae8b9877071b4e79aeb8dd7ac99af.tar.gz
bcm5719-llvm-45b1ab11b7aae8b9877071b4e79aeb8dd7ac99af.zip
Availability: attach the note to the declaration with the attributes.
Sometimes, the declaration we found has inherited availability attributes, attaching the note to it does not tell us where the availability attributes are in the source. Go through the redecl chain to find the declaration with actual availability attributes. rdar://25221771 llvm-svn: 268786
Diffstat (limited to 'clang/test/Sema/attr-availability-macosx.c')
-rw-r--r--clang/test/Sema/attr-availability-macosx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Sema/attr-availability-macosx.c b/clang/test/Sema/attr-availability-macosx.c
index 21a79ff17a1..6991f14d950 100644
--- a/clang/test/Sema/attr-availability-macosx.c
+++ b/clang/test/Sema/attr-availability-macosx.c
@@ -45,3 +45,14 @@ enum {
enum __attribute__((availability(macosx,introduced=8.0,deprecated=9.0))) {
bar1 = foo
};
+
+// Make sure the note is on the declaration with the actual availability attributes.
+struct __attribute__((availability(macosx,strict,introduced=10.9))) type_info // \
+ expected-note{{'type_info' has been explicitly marked unavailable here}}
+{
+};
+struct type_info;
+int test2() {
+ struct type_info *t; // expected-error{{'type_info' is unavailable: introduced in OS X 10.9}}
+ return 0;
+}
OpenPOWER on IntegriCloud