]> granicus.if.org Git - clang/commitdiff
fixes location of "availability" attribute so warning is displayed at
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 23 Jan 2012 23:38:32 +0000 (23:38 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 23 Jan 2012 23:38:32 +0000 (23:38 +0000)
its line. // rdar://10711037

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148747 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp
test/Sema/attr-availability.c

index cf90105655d90cc38c0c0f4d65acf47d7e7997fd..ac9b11289dc6976c3d472803b75624e58a99db07 100644 (file)
@@ -690,7 +690,7 @@ void Parser::ParseAvailabilityAttribute(IdentifierInfo &Availability,
   // Record this attribute
   attrs.addNew(&Availability, 
                SourceRange(AvailabilityLoc, T.getCloseLocation()), 
-               0, SourceLocation(),
+               0, AvailabilityLoc,
                Platform, PlatformLoc,
                Changes[Introduced],
                Changes[Deprecated],
index cbcdd382aaf01b8c18cb23c80afdc35ba02820ca..0e6ea9697b55d129aaa0b1b1450e112a5a269929 100644 (file)
@@ -17,3 +17,10 @@ void test_10095131() {
   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,
+};