From: Fariborz Jahanian Date: Fri, 14 Oct 2011 17:34:08 +0000 (+0000) Subject: objc-arc: Improve arc diagnostic when method is not X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1de8cb4b5b1c4139ebfc266ba5d3842421fc8a8;p=clang objc-arc: Improve arc diagnostic when method is not found in receiver's class. // rdar://9970739 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141961 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 97a136f895..ab4a843e14 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2998,8 +2998,7 @@ def err_arc_method_not_found : Error< def err_arc_receiver_forward_class : Error< "receiver %0 for class message is a forward declaration">; def err_arc_may_not_respond : Error< - "receiver type %0 for instance message does not declare a method with " - "selector %1">; + "no visible @interface for %0 declares the selector %1">; def err_arc_receiver_forward_instance : Error< "receiver type %0 for instance message is a forward declaration">; def err_arc_collection_forward : Error< diff --git a/test/SemaObjC/arc.m b/test/SemaObjC/arc.m index dc5a1fe922..ed6e60d8dc 100644 --- a/test/SemaObjC/arc.m +++ b/test/SemaObjC/arc.m @@ -668,3 +668,20 @@ void test38() { void _NSCalc(NSColor* color, NSColor* bezelColors[]) __attribute__((unavailable("not available in automatic reference counting mode"))); void _NSCalcBeze(NSColor* color, NSColor* bezelColors[]); // expected-error {{must explicitly describe intended ownership of an object array parameter}} + +// rdar://9970739 +@interface RestaurantTableViewCell +- (void) restaurantLocation; +@end + +@interface Radar9970739 +- (void) Meth; +@end + +@implementation Radar9970739 +- (void) Meth { + RestaurantTableViewCell *cell; + [cell restaurantLocatoin]; // expected-error {{no visible @interface for 'RestaurantTableViewCell' declares the selector 'restaurantLocatoin'}} +} +@end +