From: Fariborz Jahanian Date: Sat, 26 Mar 2011 17:07:06 +0000 (+0000) Subject: Make diagnostic clearer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d9ce907a7a77dba1f81bfff6af05f7cbe31b115;p=clang Make diagnostic clearer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128343 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 670b87883e..cee572e7a2 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2716,9 +2716,9 @@ def err_imaginary_not_supported : Error<"imaginary types are not supported">; def warn_root_inst_method_not_found : Warning< "instance method %0 is being used on 'Class' which is not in the root class">; def warn_class_method_not_found : Warning< - "method %objcclass0 not found (return type defaults to 'id')">; + "class method %objcclass0 not found (return type defaults to 'id')">; def warn_inst_method_not_found : Warning< - "method %objcinstance0 not found (return type defaults to 'id')">; + "instance method %objcinstance0 not found (return type defaults to 'id')">; def error_no_super_class_message : Error< "no @interface declaration found in class messaging of %0">; def error_root_class_cannot_use_super : Error< diff --git a/test/SemaObjC/call-super-2.m b/test/SemaObjC/call-super-2.m index 84a625c404..d77b759ffa 100644 --- a/test/SemaObjC/call-super-2.m +++ b/test/SemaObjC/call-super-2.m @@ -35,8 +35,8 @@ id objc_getClass(const char *s); @implementation Derived + (int) class_func1 { - int i = (size_t)[self class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}} - return i + (size_t)[super class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}} + int i = (size_t)[self class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}} + return i + (size_t)[super class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}} } + (int) class_func2 { @@ -55,8 +55,8 @@ id objc_getClass(const char *s); } + (int) class_func5 { - int i = (size_t)[Derived class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}} - return i + (size_t)[Object class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}} + int i = (size_t)[Derived class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}} + return i + (size_t)[Object class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}} } + (int) class_func6 { @@ -68,7 +68,7 @@ id objc_getClass(const char *s); } - (int) instance_func1 { - int i = (size_t)[self instance_func0]; // expected-warning {{method '-instance_func0' not found (return type defaults to 'id'))}} + int i = (size_t)[self instance_func0]; // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id'))}} return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0')}} } - (int) instance_func2 @@ -85,8 +85,8 @@ id objc_getClass(const char *s); } - (int) instance_func5 { - int i = (size_t)[Derived instance_func1]; // expected-warning {{method '+instance_func1' not found (return type defaults to 'id')}} - return i + (size_t)[Object instance_func1]; // expected-warning {{method '+instance_func1' not found (return type defaults to 'id')}} + int i = (size_t)[Derived instance_func1]; // expected-warning {{class method '+instance_func1' not found (return type defaults to 'id')}} + return i + (size_t)[Object instance_func1]; // expected-warning {{class method '+instance_func1' not found (return type defaults to 'id')}} } - (int) instance_func6 { diff --git a/test/SemaObjC/method-not-defined.m b/test/SemaObjC/method-not-defined.m index 78bf650272..ed68b22945 100644 --- a/test/SemaObjC/method-not-defined.m +++ b/test/SemaObjC/method-not-defined.m @@ -7,7 +7,7 @@ void test() { Foo *fooObj; id obj; - [[Foo alloc] init]; // expected-warning {{method '+alloc' not found (return type defaults to 'id')}} expected-warning {{method '-init' not found (return type defaults to 'id')}} - [fooObj notdefined]; // expected-warning {{method '-notdefined' not found (return type defaults to 'id')}} - [obj whatever:1 :2 :3]; // expected-warning {{method '-whatever:::' not found (return type defaults to 'id'))}} + [[Foo alloc] init]; // expected-warning {{class method '+alloc' not found (return type defaults to 'id')}} expected-warning {{instance method '-init' not found (return type defaults to 'id')}} + [fooObj notdefined]; // expected-warning {{instance method '-notdefined' not found (return type defaults to 'id')}} + [obj whatever:1 :2 :3]; // expected-warning {{instance method '-whatever:::' not found (return type defaults to 'id'))}} } diff --git a/test/SemaObjC/property-lookup-in-id.m b/test/SemaObjC/property-lookup-in-id.m index 389e0bdba7..86da48e851 100644 --- a/test/SemaObjC/property-lookup-in-id.m +++ b/test/SemaObjC/property-lookup-in-id.m @@ -25,7 +25,7 @@ extern id NSApp; - (void)startFSEventGathering:(id)sender { - fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{warning: method '-delegate' not found (return type defaults to 'id')}} \ + fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{warning: instance method '-delegate' not found (return type defaults to 'id')}} \ // expected-error {{property 'fsEventStream' not found on object of type 'id'}} }