[cfe-commits] r128343 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/SemaObjC/call-super-2.m test/SemaObjC/method-not-defined.m test/SemaObjC/property-lookup-in-id.m

Fariborz Jahanian fjahanian at apple.com
Sat Mar 26 10:07:06 PDT 2011


Author: fjahanian
Date: Sat Mar 26 12:07:06 2011
New Revision: 128343

URL: http://llvm.org/viewvc/llvm-project?rev=128343&view=rev
Log:
Make diagnostic clearer.


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

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=128343&r1=128342&r2=128343&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat Mar 26 12:07:06 2011
@@ -2716,9 +2716,9 @@
 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<

Modified: cfe/trunk/test/SemaObjC/call-super-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/call-super-2.m?rev=128343&r1=128342&r2=128343&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/call-super-2.m (original)
+++ cfe/trunk/test/SemaObjC/call-super-2.m Sat Mar 26 12:07:06 2011
@@ -35,8 +35,8 @@
 @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 @@
 }   
 + (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 @@
 }
 - (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 @@
 }   
 - (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
 {

Modified: cfe/trunk/test/SemaObjC/method-not-defined.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-not-defined.m?rev=128343&r1=128342&r2=128343&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-not-defined.m (original)
+++ cfe/trunk/test/SemaObjC/method-not-defined.m Sat Mar 26 12:07:06 2011
@@ -7,7 +7,7 @@
   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'))}}
 }

Modified: cfe/trunk/test/SemaObjC/property-lookup-in-id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-lookup-in-id.m?rev=128343&r1=128342&r2=128343&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-lookup-in-id.m (original)
+++ cfe/trunk/test/SemaObjC/property-lookup-in-id.m Sat Mar 26 12:07:06 2011
@@ -25,7 +25,7 @@
 
 - (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'}}
 
 }





More information about the cfe-commits mailing list