r261548 - Add has_feature attribute_availability_with_strict.

Manman Ren via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 10:24:32 PST 2016


Author: mren
Date: Mon Feb 22 12:24:30 2016
New Revision: 261548

URL: http://llvm.org/viewvc/llvm-project?rev=261548&view=rev
Log:
Add has_feature attribute_availability_with_strict.

rdar://23791325

Modified:
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/test/Sema/attr-availability-macosx.c

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=261548&r1=261547&r2=261548&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon Feb 22 12:24:30 2016
@@ -1066,6 +1066,7 @@ static bool HasFeature(const Preprocesso
       .Case("attribute_availability_with_version_underscores", true)
       .Case("attribute_availability_tvos", true)
       .Case("attribute_availability_watchos", true)
+      .Case("attribute_availability_with_strict", true)
       .Case("attribute_cf_returns_not_retained", true)
       .Case("attribute_cf_returns_retained", true)
       .Case("attribute_cf_returns_on_parameters", true)

Modified: cfe/trunk/test/Sema/attr-availability-macosx.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-availability-macosx.c?rev=261548&r1=261547&r2=261548&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-availability-macosx.c (original)
+++ cfe/trunk/test/Sema/attr-availability-macosx.c Mon Feb 22 12:24:30 2016
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 "-triple" "x86_64-apple-darwin9.0.0" -fsyntax-only -verify %s
 
+#if !__has_feature(attribute_availability_with_strict)
+#error "Missing __has_feature"
+#endif
+
 void f0(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6)));
 void f1(int) __attribute__((availability(macosx,introduced=10.5)));
 void f2(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5))); // expected-note {{'f2' has been explicitly marked deprecated here}}




More information about the cfe-commits mailing list