]> granicus.if.org Git - clang/commitdiff
Make diagnostic clearer.
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 26 Mar 2011 17:07:06 +0000 (17:07 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 26 Mar 2011 17:07:06 +0000 (17:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128343 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/SemaObjC/call-super-2.m
test/SemaObjC/method-not-defined.m
test/SemaObjC/property-lookup-in-id.m

index 670b87883e896d0fc8c1df425640cb418a4c49b8..cee572e7a2abab170db0f66310aeb7ebd4d1e61a 100644 (file)
@@ -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<
index 84a625c404ec9559d7a2d037ce6e68f620492fdc..d77b759ffa731f6da4336d299c1391f3e5d7de3a 100644 (file)
@@ -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
 {
index 78bf65027284b176b343603e2d1b0d252f7a42d2..ed68b22945c42547b0c9d31d6b7cfd79e831b407 100644 (file)
@@ -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'))}}
 }
index 389e0bdba70fc57559f4aa2dd68d5777c0b978f0..86da48e85105bab7639cec2ffebca96adc81c45e 100644 (file)
@@ -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'}}
 
 }