mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-15 23:40:54 +00:00
Improve text of a diagnostic.
llvm-svn: 143353
This commit is contained in:
parent
300dcb8e37
commit
d01ddd1d07
@ -3043,7 +3043,7 @@ def err_arc_mismatched_cast : Error<
|
||||
"an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
|
||||
" to %3 is disallowed with ARC">;
|
||||
def err_arc_nolifetime_behavior : Error<
|
||||
"explicit ownership qualifier on cast result would have no effect">;
|
||||
"explicit ownership qualifier on cast result has no effect">;
|
||||
def err_arc_objc_object_in_struct : Error<
|
||||
"ARC forbids Objective-C objects in structs or unions">;
|
||||
def err_arc_objc_property_default_assign_on_object : Error<
|
||||
|
@ -17,14 +17,14 @@ typedef __autoreleasing NSString * AUTORELEASEPNSString;
|
||||
- (CFStringRef)myString
|
||||
{
|
||||
CFStringRef myString =
|
||||
(__bridge CFStringRef) (__strong NSString *)CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
(__bridge CFStringRef) (__strong NSString *)CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
|
||||
myString =
|
||||
(__bridge CFStringRef) (__autoreleasing PNSString) CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
(__bridge CFStringRef) (__autoreleasing PNSString) CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
myString =
|
||||
(__bridge CFStringRef) (AUTORELEASEPNSString) CFBridgingRelease(); // OK
|
||||
myString =
|
||||
(__bridge CFStringRef) (typeof(__strong NSString *)) CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
(__bridge CFStringRef) (typeof(__strong NSString *)) CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
return myString;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ int main() {
|
||||
|
||||
ns1 = (__weak sub *)obj; // expected-error {{assignment of a weak-unavailable object to a __weak object}} \
|
||||
// expected-error {{class is incompatible with __weak references}} \
|
||||
// expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
// expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
}
|
||||
|
||||
// rdar://9732636
|
||||
@ -32,7 +32,7 @@ NOWEAK * Test1() {
|
||||
|
||||
__weak id weak2 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
|
||||
return (__weak id)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK *' to a __weak object of type '__weak id'}} \
|
||||
// expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
// expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
}
|
||||
|
||||
@protocol P @end
|
||||
@ -45,6 +45,6 @@ NOWEAK<P, P1> * Test2() {
|
||||
|
||||
__weak id<P> weak2 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
|
||||
return (__weak id<P>)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK<P,P1> *' to a __weak object of type '__weak id<P>'}} \
|
||||
// expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
// expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ int main() {
|
||||
|
||||
ns1 = (__weak sub *)obj; // expected-error {{assignment of a weak-unavailable object to a __weak object}} \
|
||||
// expected-error {{class is incompatible with __weak references}} \
|
||||
// expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
// expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
}
|
||||
|
||||
// rdar://9732636
|
||||
@ -32,7 +32,7 @@ NOWEAK * Test1() {
|
||||
|
||||
__weak id weak2 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
|
||||
return (__weak id)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK *' to a __weak object of type '__weak id'}} \
|
||||
// expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
// expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
}
|
||||
|
||||
@protocol P @end
|
||||
@ -45,6 +45,6 @@ NOWEAK<P, P1> * Test2() {
|
||||
|
||||
__weak id<P> weak2 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
|
||||
return (__weak id<P, P1>)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK<P,P1> *' to a __weak object of type '__weak id<P,P1>'}} \
|
||||
// expected-error {{explicit ownership qualifier on cast result would have no effect}}
|
||||
// expected-error {{explicit ownership qualifier on cast result has no effect}}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user