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
This commit is contained in:
Ted Kremenek 2012-02-03 05:01:51 +00:00
Родитель 2e5156274b
Коммит d603bd1268
2 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -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<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>,
DefaultError;
InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
}
def err_objc_illegal_visibility_spec : Error<

Просмотреть файл

@ -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() {