fixes location of "availability" attribute so warning is displayed at
its line. // rdar://10711037
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148747 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index cf90105..ac9b112 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -690,7 +690,7 @@
// Record this attribute
attrs.addNew(&Availability,
SourceRange(AvailabilityLoc, T.getCloseLocation()),
- 0, SourceLocation(),
+ 0, AvailabilityLoc,
Platform, PlatformLoc,
Changes[Introduced],
Changes[Deprecated],
diff --git a/test/Sema/attr-availability.c b/test/Sema/attr-availability.c
index cbcdd38..0e6ea96 100644
--- a/test/Sema/attr-availability.c
+++ b/test/Sema/attr-availability.c
@@ -17,3 +17,10 @@
ATSFontGetName("Hello"); // expected-warning {{'ATSFontGetName' is deprecated: first deprecated in Mac OS X 9.0 - use CTFontCopyFullName}}
ATSFontGetPostScriptName(100); // expected-error {{'ATSFontGetPostScriptName' is unavailable: obsoleted in Mac OS X 9.0 - use ATSFontGetFullPostScriptName}}
}
+
+// rdar://10711037
+__attribute__((availability(macos, unavailable))) // expected-warning {{attribute 'availability' is ignored}}
+enum {
+ NSDataWritingFileProtectionWriteOnly = 0x30000000,
+ NSDataWritingFileProtectionCompleteUntilUserAuthentication = 0x40000000,
+};