[cfe-commits] r128337 - in /cfe/trunk: lib/Lex/PPMacroExpansion.cpp test/Parser/attr-availability.c
Douglas Gregor
dgregor at apple.com
Sat Mar 26 05:16:16 PDT 2011
Author: dgregor
Date: Sat Mar 26 07:16:15 2011
New Revision: 128337
URL: http://llvm.org/viewvc/llvm-project?rev=128337&view=rev
Log:
Add a __has_feature check for the 'availability' attribute
Modified:
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
cfe/trunk/test/Parser/attr-availability.c
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=128337&r1=128336&r2=128337&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Sat Mar 26 07:16:15 2011
@@ -530,6 +530,7 @@
return llvm::StringSwitch<bool>(II->getName())
.Case("attribute_analyzer_noreturn", true)
+ .Case("attribute_availability", true)
.Case("attribute_cf_returns_not_retained", true)
.Case("attribute_cf_returns_retained", true)
.Case("attribute_deprecated_with_message", true)
Modified: cfe/trunk/test/Parser/attr-availability.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/attr-availability.c?rev=128337&r1=128336&r2=128337&view=diff
==============================================================================
--- cfe/trunk/test/Parser/attr-availability.c (original)
+++ cfe/trunk/test/Parser/attr-availability.c Sat Mar 26 07:16:15 2011
@@ -1,4 +1,9 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#if !__has_feature(attribute_availability)
+# error 'availability' attribute is not available
+#endif
+
void f0() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
void f1() __attribute__((availability(macosx,deprecated=10.4,introduced=10.2,obsoleted=10.6)));
More information about the cfe-commits
mailing list