]> granicus.if.org Git - clang/commitdiff
Add a __has_feature check for arc_cf_code_audited.
authorJohn McCall <rjmccall@apple.com>
Tue, 18 Oct 2011 21:18:53 +0000 (21:18 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 18 Oct 2011 21:18:53 +0000 (21:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142423 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPMacroExpansion.cpp
test/SemaObjC/arc-cf.m

index e10c95c75f25d879d7446251023ebd6bc4acb0b6..50929158b241e9cc39f589faee98485b38ee2f39 100644 (file)
@@ -610,6 +610,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("ownership_holds", true)
            .Case("ownership_returns", true)
            .Case("ownership_takes", true)
+           .Case("arc_cf_code_audited", true)
            // C1X features
            .Case("c_alignas", LangOpts.C1X)
            .Case("c_generic_selections", LangOpts.C1X)
index b9a44d9e68c40fef3cf5f9a283ab30201cde28d6..e7dcc22d56cd9f3e2b734db39d8775bdde7d9823 100644 (file)
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify %s
 
+#if __has_feature(arc_cf_code_audited)
+char _global[-1]; // expected-error {{declared as an array with a negative size}}
+#endif
+
 typedef const void *CFTypeRef;
 typedef const struct __CFString *CFStringRef;