forked from OSchip/llvm-project
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:
parent
402230e633
commit
172039a89c
|
@ -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<
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue