From d603bd12680c832d81f98568223ce0171e16a967 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 3 Feb 2012 05:01:51 +0000 Subject: [PATCH] Further downgrade -Warc-bridge-casts-disallowed-in-nonarc to a warning (not mapped to an error). We can consider mapping it back to an error later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149670 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticParseKinds.td | 4 ++-- test/SemaObjC/illegal-nonarc-bridged-cast.m | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 73d7883fbe..b62335bf74 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -330,10 +330,10 @@ def err_illegal_super_cast : Error< let CategoryName = "ARC Parse Issue" in { def err_arc_bridge_retain : Error< "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">; +// To be default mapped to an error later. def err_arc_bridge_cast_nonarc : Warning< "'%0' casts are only allowed when using ARC">, - InGroup>, - DefaultError; + InGroup>; } def err_objc_illegal_visibility_spec : Error< diff --git a/test/SemaObjC/illegal-nonarc-bridged-cast.m b/test/SemaObjC/illegal-nonarc-bridged-cast.m index fe6b24a634..6ff0f470de 100644 --- a/test/SemaObjC/illegal-nonarc-bridged-cast.m +++ b/test/SemaObjC/illegal-nonarc-bridged-cast.m @@ -16,19 +16,19 @@ id CreateSomething(); NSString *CreateNSString(); void from_cf() { - id obj1 = (__bridge_transfer id)CFCreateSomething(); // expected-error {{'__bridge_transfer' casts are only allowed when using ARC}} - id obj2 = (__bridge_transfer NSString*)CFCreateString(); // expected-error {{'__bridge_transfer' casts are only allowed when using ARC}} - (__bridge int*)CFCreateSomething(); // expected-error {{'__bridge' casts are only allowed when using ARC}} \ + id obj1 = (__bridge_transfer id)CFCreateSomething(); // expected-warning {{'__bridge_transfer' casts are only allowed when using ARC}} + id obj2 = (__bridge_transfer NSString*)CFCreateString(); // expected-warning {{'__bridge_transfer' casts are only allowed when using ARC}} + (__bridge int*)CFCreateSomething(); // expected-warning {{'__bridge' casts are only allowed when using ARC}} \ // expected-warning {{expression result unused}} - id obj3 = (__bridge id)CFGetSomething(); // expected-error {{'__bridge' casts are only allowed when using ARC}} - id obj4 = (__bridge NSString*)CFGetString(); // expected-error {{'__bridge' casts are only allowed when using ARC}} + id obj3 = (__bridge id)CFGetSomething(); // expected-warning {{'__bridge' casts are only allowed when using ARC}} + id obj4 = (__bridge NSString*)CFGetString(); // expected-warning {{'__bridge' casts are only allowed when using ARC}} } void to_cf(id obj) { - CFTypeRef cf1 = (__bridge_retained CFTypeRef)CreateSomething(); // expected-error {{'__bridge_retained' casts are only allowed when using ARC}} - CFStringRef cf2 = (__bridge_retained CFStringRef)CreateNSString(); // expected-error {{'__bridge_retained' casts are only allowed when using ARC}} - CFTypeRef cf3 = (__bridge CFTypeRef)CreateSomething(); // expected-error {{'__bridge' casts are only allowed when using ARC}} - CFStringRef cf4 = (__bridge CFStringRef)CreateNSString(); // expected-error {{'__bridge' casts are only allowed when using ARC}} + CFTypeRef cf1 = (__bridge_retained CFTypeRef)CreateSomething(); // expected-warning {{'__bridge_retained' casts are only allowed when using ARC}} + CFStringRef cf2 = (__bridge_retained CFStringRef)CreateNSString(); // expected-warning {{'__bridge_retained' casts are only allowed when using ARC}} + CFTypeRef cf3 = (__bridge CFTypeRef)CreateSomething(); // expected-warning {{'__bridge' casts are only allowed when using ARC}} + CFStringRef cf4 = (__bridge CFStringRef)CreateNSString(); // expected-warning {{'__bridge' casts are only allowed when using ARC}} } void fixits() { -- 2.40.0