From: Fariborz Jahanian Date: Mon, 31 Oct 2011 17:27:06 +0000 (+0000) Subject: Improve text of a diagnostic. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56892c1c293d43b99fd84d27c831b1ce30541b0f;p=clang Improve text of a diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143353 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 4c1e868548..1b1d0b151d 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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< diff --git a/test/SemaObjC/arc-objc-lifetime.m b/test/SemaObjC/arc-objc-lifetime.m index 2318fbfccd..82c6389271 100644 --- a/test/SemaObjC/arc-objc-lifetime.m +++ b/test/SemaObjC/arc-objc-lifetime.m @@ -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; } diff --git a/test/SemaObjC/arc-unavailable-for-weakref.m b/test/SemaObjC/arc-unavailable-for-weakref.m index 210727ad39..fdf850206c 100644 --- a/test/SemaObjC/arc-unavailable-for-weakref.m +++ b/test/SemaObjC/arc-unavailable-for-weakref.m @@ -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 * Test2() { __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}} } diff --git a/test/SemaObjCXX/arc-unavailable-for-weakref.mm b/test/SemaObjCXX/arc-unavailable-for-weakref.mm index 2347061cfd..2a80aebaf8 100644 --- a/test/SemaObjCXX/arc-unavailable-for-weakref.mm +++ b/test/SemaObjCXX/arc-unavailable-for-weakref.mm @@ -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 * Test2() { __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}} }