Make error about using bridge casts in non-ARC mode a warning that is default mapped to an error. This is to ease the transition of large apps moving from non-ARC to ARC.

llvm-svn: 149659
This commit is contained in:
Ted Kremenek 2012-02-03 01:30:34 +00:00
parent 402230e633
commit 172039a89c
2 changed files with 11 additions and 2 deletions

View File

@ -330,8 +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?">;
def err_arc_bridge_cast_nonarc : Error<
"'%0' casts are only allowed when using ARC">;
def err_arc_bridge_cast_nonarc : Warning<
"'%0' casts are only allowed when using ARC">,
InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>,
DefaultError;
}
def err_objc_illegal_visibility_spec : Error<

View File

@ -35,3 +35,10 @@ void fixits() {
id obj1 = (id)CFCreateSomething();
CFTypeRef cf1 = (CFTypeRef)CreateSomething();
}
#pragma clang diagnostic ignored "-Warc-bridge-casts-disallowed-in-nonarc"
void to_cf_ignored(id obj) {
CFTypeRef cf1 = (__bridge_retained CFTypeRef)CreateSomething(); // no-warning
CFTypeRef cf3 = (__bridge CFTypeRef)CreateSomething(); // no-warning
}