From: John McCall Date: Tue, 18 Oct 2011 21:18:53 +0000 (+0000) Subject: Add a __has_feature check for arc_cf_code_audited. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb2ac8b349e181bdc71bfd64980c019be3180d76;p=clang Add a __has_feature check for arc_cf_code_audited. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142423 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index e10c95c75f..50929158b2 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -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) diff --git a/test/SemaObjC/arc-cf.m b/test/SemaObjC/arc-cf.m index b9a44d9e68..e7dcc22d56 100644 --- a/test/SemaObjC/arc-cf.m +++ b/test/SemaObjC/arc-cf.m @@ -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;